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.

Severity (CVSS 3.1)4.4Medium
Exploit odds (30 days)1.2%top 31.5% of all CVEs
Exploited in the wildNo reportsnot in CISA KEV
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
Debian:12ruby-secure-headers6.3.1-1DEBIAN-CVE-2020-5216
Debian:13ruby-secure-headers6.3.1-1DEBIAN-CVE-2020-5216
Debian:14ruby-secure-headers6.3.1-1DEBIAN-CVE-2020-5216
RubyGemssecure_headers6.3.0GHSA-w978-rmpf-qmwg
RubyGemssecure_headers5.2.0GHSA-w978-rmpf-qmwg
RubyGemssecure_headers3.9.0GHSA-w978-rmpf-qmwg

Affected products (as reported)

VendorProductVersions
Twitter 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

References