CVE-2020-5217 | Directive 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.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.

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

Conclusion & alert: CVE-2020-5217 is rated High Exploit Risk (60.4/100): CVSS Medium severity, with medium exploitation likelihood (EPSS 1.81%). Core evidence: 1 public exploit reference(s) are indexed (Exploit-DB). EPSS rose +1.29% over the last day, indicating growing attacker interest. 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-5217

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

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

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.52% 1.81% +1.29%
2 2025-11-21 0.40% 0.52% +0.12%
3 2025-11-18 0.40%

Full EPSS history (13 records total)

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

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-5217

GitHub Security Advisory for CVE-2020-5217

GHSA-xq52-rv6w-397c · Severity: medium · Ecosystem: rubygems — Directive injection when using dynamic overrides with user input

OS Trackers for CVE-2020-5217

vendor priority summary link
debian not yet assigned CVE-2020-5217 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-5217
redhat medium https://access.redhat.com/security/cve/CVE-2020-5217
ubuntu medium CVE-2020-5217 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, needs-triage 3, DNE 2, ignored 1. https://ubuntu.com/security/CVE-2020-5217

Affected software / configurations for CVE-2020-5217

Vendor Product Version Raw CPE
twitter secure_headers < 3.8.0 cpe:2.3:a:twitter:secure_headers:*:*:*:*:*:ruby:*:*
twitter secure_headers >= 5.0.0, < 5.1.0 cpe:2.3:a:twitter:secure_headers:*:*:*:*:*:ruby:*:*
twitter secure_headers >= 6.0.0, < 6.2.0 cpe:2.3:a:twitter:secure_headers:*:*:*:*:*:ruby:*:*

References for CVE-2020-5217

cvelogic Threat Intelligence