Directive injection when using dynamic overrides with user input in RubyGems secure_headers
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
- Jan 22, 2020
- Updated
- Jun 16, 2026
- EPSS
- 1.8% · 78th percentile
- CWE
- CWE-95
Sign in to follow · You’ll be notified if a followed record enters KEV, gets an exploit or is updated.
Report tools
Action score
24
Monitor
Low priority for now.
- CVSS
- 23 / 40 · 5.8 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 1 / 30 · 1.8%
CNA vs NVD score
- NVD
- 5.8
- CNA · GitHub_M
- 4.4
- 1.4 point gap
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N
The score given by the assigning authority versus NVD’s independent score. A gap means the severity is contested.
Affected systems
| Vendor | Product | CPE |
|---|---|---|
| secure headers | cpe:2.3:a:twitter:secure_headers |
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- twitter secure headersbefore 3.8.0
- twitter secure headers5.0.0 and later · before 5.1.0
- twitter secure headers6.0.0 and later · before 6.2.0
Versions reported by the vendor
Affected version ranges reported by the assigning authority (GitHub_M). Independent of NVD's CPE analysis and usually ahead of it.
Twitter secure_headers
- < 3.8.0, >= 5.0.0, < 5.1.0, >= 6.0.0, < 6.2.0affected
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| Debian:12 | ruby-secure-headers | before 6.3.1-1 | 6.3.1-1 |
| Red Hat:satellite_capsule:6.8::el7 | ansible-collection-redhat-satellite | before 0:1.3.0-1.el7sat | 0:1.3.0-1.el7sat |
| Red Hat:satellite_capsule:6.8::el7 | ansible-runner | before 0:1.4.6-1.el7ar | 0:1.4.6-1.el7ar |
| Red Hat:satellite_capsule:6.8::el7 | ansiblerole-foreman_scap_client | before 0:0.0.5-1.el7sat | 0:0.0.5-1.el7sat |
| Red Hat:satellite_capsule:6.8::el7 | ansiblerole-insights-client | before 0:1.7.1-1.el7sat | 0:1.7.1-1.el7sat |
| Red Hat:satellite_capsule:6.8::el7 | ansiblerole-satellite-receptor-installer | before 0:0.6.13-1.el7sat | 0:0.6.13-1.el7sat |
| Red Hat:satellite_capsule:6.8::el7 | crane-selinux | before 0:3.4.0-1.el7sat | 0:3.4.0-1.el7sat |
| Red Hat:satellite_capsule:6.8::el7 | createrepo_c | before 0:0.7.4-1.el7sat | 0:0.7.4-1.el7sat |
| Red Hat:satellite_capsule:6.8::el7 | createrepo_c-debuginfo | before 0:0.7.4-1.el7sat | 0:0.7.4-1.el7sat |
| Red Hat:satellite_capsule:6.8::el7 | createrepo_c-libs | before 0:0.7.4-1.el7sat | 0:0.7.4-1.el7sat |
| Red Hat:satellite_capsule:6.8::el7 | foreman | before 0:2.1.2.19-1.el7sat | 0:2.1.2.19-1.el7sat |
| Red Hat:satellite_capsule:6.8::el7 | foreman-bootloaders-redhat | before 0:202005201200-1.el7sat | 0:202005201200-1.el7sat |
| Red Hat:satellite_capsule:6.8::el7 | foreman-bootloaders-redhat-tftpboot | before 0:202005201200-1.el7sat | 0:202005201200-1.el7sat |
| Red Hat:satellite_capsule:6.8::el7 | foreman-debug | before 0:2.1.2.19-1.el7sat | 0:2.1.2.19-1.el7sat |
| Red Hat:satellite_capsule:6.8::el7 | foreman-discovery-image | before 1:3.6.7-1.el7sat | 1:3.6.7-1.el7sat |
| Red Hat:satellite_capsule:6.8::el7 | foreman-discovery-image-service | before 0:1.0.0-3.el7sat | 0:1.0.0-3.el7sat |
| Red Hat:satellite_capsule:6.8::el7 | foreman-discovery-image-service-tui | before 0:1.0.0-3.el7sat | 0:1.0.0-3.el7sat |
| Red Hat:satellite_capsule:6.8::el7 | foreman-installer | before 1:2.1.2.8-1.el7sat | 1:2.1.2.8-1.el7sat |
| Red Hat:satellite_capsule:6.8::el7 | foreman-installer-katello | before 1:2.1.2.8-1.el7sat | 1:2.1.2.8-1.el7sat |
| Red Hat:satellite_capsule:6.8::el7 | foreman-proxy | before 0:2.1.2-2.el7sat | 0:2.1.2-2.el7sat |
| Red Hat:satellite_capsule:6.8::el7 | foreman-proxy-content | before 0:3.16.0-1.el7sat | 0:3.16.0-1.el7sat |
| Red Hat:satellite_capsule:6.8::el7 | foreman-proxy-journald | before 0:2.1.2-2.el7sat | 0:2.1.2-2.el7sat |
| Red Hat:satellite_capsule:6.8::el7 | future | before 0:0.16.0-11.el7sat | 0:0.16.0-11.el7sat |
| Red Hat:satellite_capsule:6.8::el7 | gofer | before 0:2.12.5-7.el7sat | 0:2.12.5-7.el7sat |
+96
Same product
twitter: all recordsOther highest-scoring records for the same primary product.
- CVE-2020-5216Limited header injection when using dynamic overrides with user input in RubyGems secure_headers23Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| debian:ruby-secure-headers | 6.3.1-1 · Debian:12 | Package registry (OSV) |
| red hat:ansible-collection-redhat-satellite | 0:1.3.0-1.el7sat · Red Hat:satellite_capsule:6.8::el7 | Package registry (OSV) |
| red hat:ansible-runner | 0:1.4.6-1.el7ar · Red Hat:satellite_capsule:6.8::el7 | Package registry (OSV) |
| red hat:ansiblerole-foreman_scap_client | 0:0.0.5-1.el7sat · Red Hat:satellite_capsule:6.8::el7 | Package registry (OSV) |
| red hat:ansiblerole-insights-client | 0:1.7.1-1.el7sat · Red Hat:satellite_capsule:6.8::el7 | Package registry (OSV) |
| red hat:ansiblerole-satellite-receptor-installer | 0:0.6.13-1.el7sat · Red Hat:satellite_capsule:6.8::el7 | Package registry (OSV) |
| red hat:crane-selinux | 0:3.4.0-1.el7sat · Red Hat:satellite_capsule:6.8::el7 | Package registry (OSV) |
| red hat:createrepo_c | 0:0.7.4-1.el7sat · Red Hat:satellite_capsule:6.8::el7 | Package registry (OSV) |
| red hat:createrepo_c-debuginfo | 0:0.7.4-1.el7sat · Red Hat:satellite_capsule:6.8::el7 | Package registry (OSV) |
| red hat:createrepo_c-libs | 0:0.7.4-1.el7sat · Red Hat:satellite_capsule:6.8::el7 | Package registry (OSV) |
| red hat:foreman | 0:2.1.2.19-1.el7sat · Red Hat:satellite_capsule:6.8::el7 | Package registry (OSV) |
| red hat:foreman-bootloaders-redhat | 0:202005201200-1.el7sat · Red Hat:satellite_capsule:6.8::el7 | Package registry (OSV) |
| red hat:foreman-bootloaders-redhat-tftpboot | 0:202005201200-1.el7sat · Red Hat:satellite_capsule:6.8::el7 | Package registry (OSV) |
| RubyGems:secure_headers | 3.8.0 | Package registry (OSV) |
| RubyGems:secure_headers | 5.1.0 | Package registry (OSV) |
| RubyGems:secure_headers | 6.2.0 | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
FIRST EPSS daily score; only changes of 0.01 or more are recorded (step chart).
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
Credits
All researchersFinders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.
No credits in the CNA record.
Variant candidates
Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.
No nightly-computed relations.
Chain candidates
An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.
—
Bug bounty scope
No known public program.
Source: bounty-targets-data (public HackerOne, Bugcrowd, Intigriti, YesWeHack listings).
Technical details
Attack conditions
- Anyone who can reach it over the internet can trigger it.
- No account or password is required.
- No user action is required.
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- none
- Integrity
- low · data or configuration can be modified
- Availability
- none
Impact can extend beyond the vulnerable component (scope changes).
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Changed
- Confidentiality impact
- None
- Integrity impact
- Low
- Availability impact
- None
Weakness class (CWE)
CWE-95 · Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection')CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N
nvd-primary
Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Noroxi analysis
No Noroxi analysis for this record yet
We don't hand-write analysis for all 385,000+ vulnerabilities; that wouldn't be honest. For notable, high-impact vulnerabilities our team writes the mechanism, detection and remediation steps.
We use this product, ask for helpChange log
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
- github.com/twitter/secure_headers/commit/936a160e3e9659737a9f9eafce13eea36b5c9fa3
- github.com/twitter/secure_headers/pull/421
- github.com/twitter/secure_headers/security/advisories/GHSA-xq52-rv6w-397c
Vendor advisories and official records. Exploit/PoC links are deliberately left out.