Vulnerability Details : CVE-2020-5217
In Secure Headers (RubyGem secure_headers), a directive injection vulnerability is present in versions before 3.8.0, 5.1.0, and 6.2.0. If user-supplied input was passed into append/override_content_security_policy_directives, a semicolon could be injected leading to directive injection. This could be used to e.g. override a script-src directive. Duplicate directives are ignored and the first one wins. The directives in secure_headers are sorted alphabetically so they pretty much all come before script-src. A previously undefined directive would receive a value even if SecureHeaders::OPT_OUT was supplied. The fixed versions will silently convert the semicolons to spaces and emit a deprecation warning when this happens. This will result in innocuous browser console messages if being exploited/accidentally used. In future releases, we will raise application errors resulting in 500s. Depending on what major version you are using, the fixed versions are 6.2.0, 5.1.0, 3.8.0.
Exploit prediction scoring system (EPSS) score for CVE-2020-5217
Probability of exploitation activity in the next 30 days: 0.15%
Percentile, the proportion of vulnerabilities that are scored at or less: ~ 50 % EPSS Score History EPSS FAQ
CVSS scores for CVE-2020-5217
Base Score | Base Severity | CVSS Vector | Exploitability Score | Impact Score | Score Source |
---|---|---|---|---|---|
5.0
|
MEDIUM | AV:N/AC:L/Au:N/C:N/I:P/A:N |
10.0
|
2.9
|
NIST |
5.8
|
MEDIUM | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N |
3.9
|
1.4
|
NIST |
4.4
|
MEDIUM | CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N |
1.3
|
2.7
|
GitHub, Inc. |
CWE ids for CVE-2020-5217
-
The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.Assigned by: nvd@nist.gov (Primary)
-
The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes code syntax before using the input in a dynamic evaluation call (e.g. "eval").Assigned by: security-advisories@github.com (Secondary)
References for CVE-2020-5217
-
https://github.com/twitter/secure_headers/commit/936a160e3e9659737a9f9eafce13eea36b5c9fa3
Merge pull request #421 from twitter/escape-semi-colons-5.x · github/secure_headers@936a160 · GitHubPatch
-
https://github.com/twitter/secure_headers/issues/418
Filtering CSP entries to prevent bypassing rules · Issue #418 · github/secure_headers · GitHubExploit;Third Party Advisory
-
https://github.com/twitter/secure_headers/security/advisories/GHSA-xq52-rv6w-397c
Directive injection when using dynamic overrides with user input · Advisory · github/secure_headers · GitHubMitigation;Third Party Advisory
-
https://github.com/twitter/secure_headers/pull/421
escape semicolons by replacing them with spaces for 5.x line by oreoshake · Pull Request #421 · github/secure_headers · GitHubThird Party Advisory
Products affected by CVE-2020-5217
- cpe:2.3:a:twitter:secure_headers:*:*:*:*:*:ruby:*:*
- cpe:2.3:a:twitter:secure_headers:*:*:*:*:*:ruby:*:*
- cpe:2.3:a:twitter:secure_headers:*:*:*:*:*:ruby:*:*