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 1484119 - mod_auth_mellon SIGSEGV in am_urldecode
Summary: mod_auth_mellon SIGSEGV in am_urldecode
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: mod_auth_mellon
Version: 7.5
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: ---
Assignee: John Dennis
QA Contact: ipa-qe
URL:
Whiteboard:
Depends On: 1472829
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-22 18:14 UTC by John Dennis
Modified: 2021-06-10 12:51 UTC (History)
7 users (show)

Fixed In Version: mod_auth_mellon-0.13.1-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1472829
Environment:
Last Closed: 2018-04-10 17:08:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3119651 0 None None None 2017-08-22 18:14:21 UTC
Red Hat Product Errata RHBA-2018:0927 0 None None None 2018-04-10 17:08:52 UTC

Comment 7 Scott Poore 2018-01-05 00:56:38 UTC
Verified.

Version ::

mod_auth_mellon-0.13.1-1.el7.x86_64


Results ::

# I setup an IPA server, and RH-SSO server and then installed apache and mod_auth_mellon.  

# keycloak-httpd-client-install       --client-originate-method registration     --keycloak-server-url https://idp.keycloak.test:8443     --keycloak-admin-username admin     --keycloak-admin-password Secret123     --app-name example_app     --keycloak-realm demorealm     --mellon-root example_app     --mellon-https-port 8443     --mellon-protected-locations "/example_app/private"     --force

I created a simple form outside the protected space like this:

[root@sp1 ~]# cat /var/www/html/test.html
<form action = "/example_app/private/test.py" method = "post">
Input: <input type = "text" name = "data">
<input type = "submit" value = "Submit" />
</form>

That form references the cgi script insite the protected space:


[root@sp1 ~]# cat /var/www/html/example_app/private/test.py
#!/usr/bin/python

import cgi

form = cgi.FieldStorage()
data = form.getvalue('data')
print """Content-type:text/html\r\n\r\n
<html>
<head>
<title>Test CGI Program</title>
</head>
<body>
<h2>Hello %s</h2>
</body>
</html>
""" % (data)

And the apache configs look like this:
# note that you must enable POST handling as done here withMellonPostReplay and MellonPostDirectory

 [root@sp1 ~]# cat /etc/httpd/conf.d/example_app_mellon_keycloak_demorealm.conf
<Location /example_app>
    MellonEnable info
    MellonEndpointPath /example_app/mellon/
    MellonSPMetadataFile /etc/httpd/saml2/example_app_sp_metadata.xml
    MellonSPPrivateKeyFile /etc/httpd/saml2/example_app.key
    MellonSPCertFile /etc/httpd/saml2/example_app.cert
    MellonIdPMetadataFile /etc/httpd/saml2/example_app_keycloak_demorealm_idp_metadata.xml
    MellonIdP IDP
</Location>

<Location /example_app/private>
    AuthType Mellon
    MellonEnable auth
    MellonPostReplay On
    Require valid-user
</Location>

MellonPostDirectory /var/cache/example_app_post_directory


Then restart httpd.

After that, I try connecting to https://sp1.keycloak.test:8443/test.html

In ssl_access_log:


[root@sp1 httpd]# tail -6 ssl_access_log
192.168.122.1 - - [04/Jan/2018:18:48:35 -0600] "GET /test.html HTTP/1.1" 200 157
192.168.122.1 - - [04/Jan/2018:18:48:55 -0600] "POST /example_app/private/test.py HTTP/1.1" 303 580
192.168.122.1 - - [04/Jan/2018:18:48:55 -0600] "GET /example_app/mellon/login?ReturnTo=https%3A%2F%2Fsp1.keycloak.test%3A8443%2Fexample_app%2Fmellon%2Frepost%3Fid%3D98ee06d11c8fbe3ee25c5519d1ab7817%26ReturnTo%3Dhttps%253A%252F%252Fsp1.keycloak.test%253A8443%252Fexample_app%252Fprivate%252Ftest.py%26enctype%3Durlencoded&IdP=https%3A%2F%2Fidp.keycloak.test%3A8443%2Fauth%2Frealms%2Fdemorealm HTTP/1.1" 303 1508
192.168.122.1 - - [04/Jan/2018:18:49:06 -0600] "POST /example_app/mellon/postResponse HTTP/1.1" 303 408
192.168.122.1 - - [04/Jan/2018:18:49:06 -0600] "GET /example_app/mellon/repost?id=98ee06d11c8fbe3ee25c5519d1ab7817&ReturnTo=https%3A%2F%2Fsp1.keycloak.test%3A8443%2Fexample_app%2Fprivate%2Ftest.py&enctype=urlencoded HTTP/1.1" 200 768
192.168.122.1 - G-ec2f0c81-78d5-4633-8a93-8ea023e51ed8 [04/Jan/2018:18:49:06 -0600] "POST /example_app/private/test.py HTTP/1.1" 200 280

Now I'll use the id from the repost to confirm the data in the cached file on the SP:

[root@sp1 httpd]# cat /var/cache/example_app_post_directory/98ee06d11c8fbe3ee25c5519d1ab7817
data=testing+a+really+long+string+that+should+be+more+than+80+characters+is+difficult+to+do+without+using+a+character+counter.++So%2C+I++will+keep+typing+for+a+while+until+I+think+I%27ve+got+it.


Just to note, in the httpd/error_log, I do see this expected warning:

(process:1726): Lasso-WARNING **: 2018-01-04 18:48:55   Encoded a RelayState of more than 80 bytes, see #3.4.3 of saml-bindings-2.0-os

But, I see no crashes or core dumps.  So, as far as I can tell this is fixed.

Comment 10 errata-xmlrpc 2018-04-10 17:08:46 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, 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-2018:0927


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