CVE-2020-5216 | Limited header injection when using dynamic overrides with user input in RubyGems secure_headers

Exp

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.

Published: 2020-01-23 Last update: 2024-11-21 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2020-5216 is rated Exploit Available (54.5/100): CVSS Medium severity, with medium exploitation likelihood (EPSS 1.08%). Core evidence: 1 public exploit reference(s) are indexed (Exploit-DB). Mandatory action: Public exploits are available—assess exposure, apply mitigations, and prioritize patching.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Public exploit references (Exploit-DB) for CVE-2020-5216

EDB-ID Source Kind Published Link
nvd_ref exploit_tag Exploit-DB ↗

Exploit prediction scoring system (EPSS) score for CVE-2020-5216

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-06-15 0.35% 1.08% +0.73%
2 2025-11-21 0.24% 0.35% +0.11%
3 2025-11-18 0.24%

Full EPSS history (12 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2020-5216

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
4.4 3.1 MEDIUM
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:H)
Even with access, the exploit needs extra luck, timing, or a fussy environment to actually work.
Privileges required (PR:L)
A normal user session is enough; they don’t have to be admin.
User interaction (UI:R)
A real person has to do something—click, install, enable—otherwise it doesn’t land.
Scope (S:C)
Breaking this can reach past the original component and bite other resources—bigger blast radius.
Confidentiality (C:L)
Some sensitive info could get out, but not a total data dump.
Integrity (I:L)
Attackers could change some data, but it’s limited—not everything goes.
Availability (A:N)
Service keeps running; no real outage angle.
1.3 2.7 [email protected]
5.8 3.1 MEDIUM
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:C)
Breaking this can reach past the original component and bite other resources—bigger blast radius.
Confidentiality (C:N)
Doesn’t really leak secrets in a meaningful way.
Integrity (I:L)
Attackers could change some data, but it’s limited—not everything goes.
Availability (A:N)
Service keeps running; no real outage angle.
3.9 1.4 [email protected]
5.0 2.0 MEDIUM
AV:N/AC:L/Au:N/C:N/I:P/A:N Click to expand
Access vector (AV:N)
Can be exploited remotely over network reachability.
Access complexity (AC:L)
Exploitation conditions are straightforward and predictable.
Authentication (AU:N)
No authentication is required.
Confidentiality impact (C:N)
No confidentiality impact.
Integrity impact (I:P)
Partial integrity impact.
Availability impact (A:N)
No availability impact.
10.0 2.9 [email protected]

Weakness enumeration for CVE-2020-5216

GitHub Security Advisory for CVE-2020-5216

GHSA-w978-rmpf-qmwg · Severity: medium · Ecosystem: rubygems — Limited header injection when using dynamic overrides with user input in RubyGems secure_headers

OS Trackers for CVE-2020-5216

vendor priority summary link
debian not yet assigned CVE-2020-5216 not yet assigned priority: Debian including 1 source packages (ruby-secure-headers), 5 status rows across 5 suites (bookworm, bullseye, forky, sid, trixie): resolved 5. https://security-tracker.debian.org/tracker/CVE-2020-5216
redhat medium https://access.redhat.com/security/cve/CVE-2020-5216
ubuntu medium CVE-2020-5216 medium priority: Ubuntu including 1 source packages (ruby-secure-headers), 17 status rows across 17 suites (bionic, eoan, focal, groovy, hirsute, impish, jammy, kinetic, lunar, mantic, noble, oracular, plucky, questing, trusty, upstream, xenial): not-affected 11, needed 3, DNE 2, ignored 1. https://ubuntu.com/security/CVE-2020-5216

Affected software / configurations for CVE-2020-5216

Vendor Product Version Raw CPE
twitter secure_headers < 3.9.0 cpe:2.3:a:twitter:secure_headers:*:*:*:*:*:ruby:*:*
twitter secure_headers >= 5.0.0, < 5.2.0 cpe:2.3:a:twitter:secure_headers:*:*:*:*:*:ruby:*:*
twitter secure_headers >= 6.0.0, < 6.3.0 cpe:2.3:a:twitter:secure_headers:*:*:*:*:*:ruby:*:*

References for CVE-2020-5216

cvelogic Threat Intelligence