Bug 1694913 - web-console: CORS allowed origin too permissive
Summary: web-console: CORS allowed origin too permissive
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1695410
Blocks: 1694910
TreeView+ depends on / blocked
 
Reported: 2019-04-02 03:40 UTC by Jason Shepherd
Modified: 2021-02-16 22:10 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
OpenShift Container Platform (OCP) 3.6, and earlier versions, were too permissive in the way it specified CORS allowed origins during installation. An attacker able to perform an XSS attack on a vulnerable cluster can use this flaw to perform a phishing attack.
Clone Of:
Environment:
Last Closed: 2019-06-20 07:11:44 UTC
Embargoed:


Attachments (Terms of Use)

Description Jason Shepherd 2019-04-02 03:40:25 UTC
OpenShift Container Platform 3.6 and earlier versions were too permissive in way it specified CORS allowed origins. An attacker able to perform an XSS attack on a vulnerable OCP cluster can use this flaw to perform a phishing attack.

Comment 1 Jason Shepherd 2019-04-02 03:40:26 UTC
Acknowledgments:

Name: Dave Baker (Red Hat)

Comment 14 Dave Baker 2019-04-03 00:45:07 UTC
One liner detection script - this will return any values in the corsAllowedOrigins list that do not start with the suggested regex pre-amble.

$ sed -ne '/^corsAllowedOrigins:/,/^[a-z]/{ /^s*-\s*[a-z]/p }'  /etc/origin/master/master-config.yaml

Comment 18 Dave Baker 2019-04-03 01:21:49 UTC
Statement:

While this issue was fixed in the installer for OCP 3.7 and later, a cluster originally installed with 3.6, then upgraded using the openshift-ansible tool remains vulnerable to this issue.

To detect if an OCP cluster is vulnerable, run this script on any master node in the cluster.  Any output generated indicates poorly formatted lines that need mitigation.

$ sed -ne '/^corsAllowedOrigins:/,/^[a-z]/{ /^s*-\s*[a-zA-Z0-9]/p }'  /etc/origin/master/master-config.yaml

Comment 20 Dave Baker 2019-06-12 14:14:56 UTC
Mitigation:

Ensure that the corsAllowedOrigin definition within master-config.yaml contains elements in the form 

~~~
corsAllowedOrigins:
- (?i)//my\.subdomain\.domain\.com(:|\z)
~~~

and not the form

~~~
corsAllowedOrigins:
- domain.com
~~~

as the first will permit cross origin requests only if the host matches exactly, whereas the second will permit from any host that merely contains the string (such as ABCDdomain.com or even domain.comABCD.com).


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