RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1785497 - cockpit-ws cannot process longer HTTPS request than 4096 bytes
Summary: cockpit-ws cannot process longer HTTPS request than 4096 bytes
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: cockpit
Version: 7.7
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: 7.9
Assignee: Martin Pitt
QA Contact: Jan Ščotka
URL:
Whiteboard:
Depends On:
Blocks: 1785509
TreeView+ depends on / blocked
 
Reported: 2019-12-20 03:14 UTC by Masahiro Matsuya
Modified: 2023-12-15 17:07 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1785509 (view as bug list)
Environment:
Last Closed: 2020-09-29 20:03:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:3950 0 None None None 2020-09-29 20:03:44 UTC

Description Masahiro Matsuya 2019-12-20 03:14:14 UTC
Description of problem:
A customer had a cockpit login issue. This login issue happened when the longer HTTP GET request was received. 

This customer configured SSO login with Kerberos for cockpit. Some user could log into the cockpit with SSO enabled, but other user could not login.

The following is the sequence I found when the problem happened.

1)  The browser sent GET method with /cockpit/login to cockipt-ws
2)  cockpit-ws created a cockpit-session process
3)  cockpit-session sent to cockpit-ws:
{"command":"authorize","cookie":"sessionXXXXXXXXXXXXXXX","challenge":"*"}
4)  cockpit-ws sent to cockpit-session:
{"command":"authorize","cookie":"sessionXXXXXXXXXXXXXXX","response":"Negotiate"}
5)  cockpit-session sent to cockpit-ws:
{"command":"authorize","cookie":"sessioXXXXXXXXXXXXXXXX","challenge":"Negotiate"}
6)  cockpit-ws sent to browser:  "HTTP/1.1 401 Authentication required" and "WWW-Authenticate: Negotiate"
7)  browser sent to cockpit-ws:  "GET /cockpit/login HTTP/1.1" and "Authorization: Negotiate YIILc..."

The size of the last GET request was 4101 bytes, and cockpit-ws didn't pass the Authorization data into cockpit-session.

This is the problem of the request buffer size in cockpit-ws. Now it's 4096.
So, it cannot process the request longer than 4096.

The customer confirmed that the problem was fixed by a test package to increase the buffer size into 8192.

I'll attach the patch on this bugzilla.

Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux 7

How reproducible:
Always reproduced with a specific user in customer's system only.

Steps to Reproduce:
1. Setup cockpit SSO configuration.
2. Make a larger HTTP request than 4096 to cockpit.
   Not sure if we can do it by intent. 

In the customer's case, the data following "Authorization: Negotiate" was too long. 


Actual results:
cockpit login didn't work with SSO with some users.

Expected results:
cockpit login works with SSO with any user.

______________________________
Acceptance Criteria (Proposal)

Given Cockpit SSO with kerberos is set, users can authenticate via kerberos
Corner case: user can log in even if HTTP request larger than 4096
(Both should be covered by automated regression test)

Comment 3 Martin Pitt 2019-12-20 08:48:22 UTC
Thanks for the report! I did some initial debugging in the cloned bug 1785509. I'm currently unable to reproduce or understand what the root cause is. Once we have a fix, I'll backport it to the rhel 7 branch.

Comment 5 Martin Pitt 2020-01-03 10:09:48 UTC
More debugging happened in bug 1785509, and this is reproducible now.

Comment 6 Martin Pitt 2020-01-03 15:47:15 UTC
I understand the issue much better now. In https://github.com/cockpit-project/cockpit/pull/13351 I sent a more robust fix, that avoids hardcoding any particular buffer size. Once that lands upstream, I'll backport it to the RHEL 7 branch.

Comment 14 Martin Pitt 2020-04-13 07:24:01 UTC
Direct link to the fixed RPM: http://download.eng.bos.redhat.com/brewroot/vol/rhel-7/packages/cockpit/195.8/1.el7_9/x86_64/cockpit-ws-195.8-1.el7_9.x86_64.rpm

This is from the official 7.9 build, so it will not time out like the above scratch build.

Comment 18 errata-xmlrpc 2020-09-29 20:03:34 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (cockpit bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:3950


Note You need to log in before you can comment on or make changes to this bug.