Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1092875 - (CVE-2014-0197) CVE-2014-0197 CFME: CSRF protection vulnerability in referrer header
CVE-2014-0197 CFME: CSRF protection vulnerability in referrer header
Status: CLOSED ERRATA
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Red Hat Product Security
impact=moderate,public=20140630,repor...
: Security
Depends On: 1142451 1142452
Blocks: 1092876
  Show dependency treegraph
 
Reported: 2014-04-30 03:31 EDT by Kurt Seifried
Modified: 2015-01-12 16:24 EST (History)
14 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-01-12 16:24:19 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Kurt Seifried 2014-04-30 03:31:16 EDT
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 request_referer_service.rb contains following:

class RequestRefererService
  def referer_valid?(referer, string_to_test)
    referer.to_s.starts_with?(string_to_test)
  end
end

This check only makes sure that referer starts with string_to_test, 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-Site_Request_Forgery_%28CSRF%29_Prevention_Cheat_Sheet#Checking_The_Referer_Header
Comment 1 Martin Povolny 2014-04-30 05:13:15 EDT
proposed upstream fix: https://github.com/ManageIQ/cfme/pull/2179
Comment 2 Kurt Seifried 2014-04-30 13:52:07 EDT
This is public now: https://github.com/ManageIQ/cfme/pull/2179
Comment 3 Martin Povolny 2014-04-30 15:57:26 EDT
The above is not "public". It's a private repo.
Comment 6 Kurt Seifried 2015-01-12 16:21:51 EST
This issue has been addressed in following products:

  CloudForms Management Engine 5.x

Via RHSA-2014:0816 https://rhn.redhat.com/errata/RHSA-2014-0816.html

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