REDHAT-BUG-1092875: CSRF

Published Apr 30, 2014
·
Updated

Jan Rusnacko of Red Hat reports:

currently CSRF protection of CFME is based on checking the referer header. Implementation of the check is not strict enough and permits attacker CSRF in certain scenarios. Assuming CFME is running on cfme.host and client's browser sent referer without a full path during authentication, attacker can mount CSRF from domain cfme.host.evil.com, which will bypass CSRF referer check.

Code in the requestrefererservice.rb contains following:

class RequestRefererService def referervalid?(referer, stringtotest) referer.tos.startswith?(stringtotest) end end

This check only makes sure that referer starts with stringtotest, with the assumption that it is FQDN of CFME host. String to test is set in DashboardController in authenticate action:

538: session['referer'] = request.referer.sub(/\?./,'')

When user first authenticates, CFME saves the referer. Login form, from which user fires off authenticate request, is located at the root, so referer should contain URL in form "https://cfme.host/". This is stripped from any parameters and saved to session['referer'], which will again contain "https://cfme.host/" for the rest of the session. Any subsequent user requests must include referer starting with "https://cfme.host/".

Sending referer header raises privacy concerns. To mitigate them, referer sent by the client may not include full URL, but only protocol+hostname instead of full path. This is exactly idea behind original proposal of Origin header (for details see [1]). Stripping full URL to hostname (or just domain) can be achieved by for example by Referer Control addon to Firefox, or perhaps implemented at network level as a part of company security policy.

If the client sends authenticate request without trailing "/", then session['referer'] will contain something like "https://cfme.host", or just "cfme.host", and attacker can simply mount CSRF from "cfme.host.evil.com" and pass the check.

This attack on broken Referer check implementation is described in OWASP CSRF prevention cheat sheet [2].

Thank you.

[1] http://seclab.stanford.edu/websec/csrf/csrf.pdf [2] https://www.owasp.org/index.php/Cross-SiteRequestForgery%28CSRF%29PreventionCheatSheet#CheckingTheRefererHeader

Affected Software

1 affected component
Red Hat CloudForms Management Engine

Event History

Apr 30, 2014
Data Sourced
via Red Hat·07:31 AM
DescriptionSeverityAffected Software

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203