Vulnerability · Published Jan 23, 2020 · Assigned by GitHub_M
CVE-2020-5216Limited header injection when using dynamic overrides with user input in RubyGems secure_headers
Medium 4.4
In plain English
A medium-severity security flaw in secure_headers from Twitter. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.2% (higher than 69% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
In Secure Headers (RubyGem secure_headers), a directive injection vulnerability is present in versions before 3.9.0, 5.2.0, and 6.3.0. If user-supplied input was passed into append/override_content_security_policy_directives, a newline could be injected leading to limited header injection. Upon seeing a newline in the header, rails will silently create a new Content-Security-Policy header with the remaining value of the original string. It will continue to create new headers for each newline. This has been fixed in 6.3.0, 5.2.0, and 3.9.0.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | ruby-secure-headers | 6.3.1-1 | DEBIAN-CVE-2020-5216 |
| Debian:13 | ruby-secure-headers | 6.3.1-1 | DEBIAN-CVE-2020-5216 |
| Debian:14 | ruby-secure-headers | 6.3.1-1 | DEBIAN-CVE-2020-5216 |
| RubyGems | secure_headers | 6.3.0 | GHSA-w978-rmpf-qmwg |
| RubyGems | secure_headers | 5.2.0 | GHSA-w978-rmpf-qmwg |
| RubyGems | secure_headers | 3.9.0 | GHSA-w978-rmpf-qmwg |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| secure_headers | < 3.9.0>= 5.0.0, < 5.2.0>= 6.0.0, < 6.3.0 |
Weakness: CWE-113 · Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N