Skip to content
Fencer Vulns
medium 4.4

CVE-2020-5217 json

Directive injection when using dynamic overrides with user input in RubyGems secure_headers

published 2020-01-23 6 y ago modified 2026-09-10 1 mo ago also GHSA-xq52-rv6w-397c , EUVD-2020-0283

cvss
4.4
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
1.8%
EPSS 1.8% chance of exploitation in 30 days, percentile 79%
public exploits
0
none known

Summary

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.

Patch / fix

  • rubygems secure_headers 3.8.0, 5.1.0, 6.2.0
  • twitter secure_headers 3.8.0, 5.1.0, 6.2.0
  • tfm satellite capsule 6.8, satellite 6.8 6.1-1.el7sat
  • kobo satellite capsule 6.8, satellite 6.8 0.5.1-1.el7sat
  • pulp satellite capsule 6.8, satellite 6.8 2.21.3-1.el7sat
  • gofer satellite capsule 6.8, satellite 6.8 2.12.5-7.el7sat
  • future satellite capsule 6.8, satellite 6.8 0.16.0-11.el7sat
  • ostree satellite capsule 6.8, satellite 6.8 2017.1-2.atomic.el7
  • foreman satellite capsule 6.8, satellite 6.8 2.1.2.19-1.el7sat
  • katello satellite capsule 6.8, satellite 6.8 3.16.0-1.el7sat

red hat advisories RHSA-2020:4366

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2020-5217 updated cvss 5.8

rubygem-secure_headers: directive injection when using dynamic overrides with user input

  • Red Hat CloudForms Management Engine 5 cfme-gemset
    affected: no fix planned “Will not fix”
  • Red Hat Satellite 6.8 tfm 6.1-1.el7sat, kobo 0.5.1-1.el7sat, pulp 2.21.3-1.el7sat, gofer 2.12.5-7.el7sat, receptor 0.6.3-1.el7ar, future 0.16.0-11.el7sat, +492 more Red Hat Satellite Capsule 6.8 tfm 6.1-1.el7sat, kobo 0.5.1-1.el7sat, pulp 2.21.3-1.el7sat, gofer 2.12.5-7.el7sat, future 0.16.0-11.el7sat, katello 3.16.0-1.el7sat, +246 more
    fixed: vendor fix RHSA-2020:4366

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

Exploit prediction

1.83% chance of exploitation in the next 30 days, higher than 79% of all scored CVEs (FIRST EPSS, 2026-11-08).

Exploits and checks

  • github.com https://github.com/twitter/secure_headers/issues/418 referenced PoC, tagged "exploit" by a source, unverified

CVSS scores

assigned by version score vector
CNA 3.1 4.4 CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N
NVD 3.1 5.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N
NVD 2.0 5.0 AV:N/AC:L/Au:N/C:N/I:P/A:N
GitHub 3.1 4.4 CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N

Affected packages

ecosystem package affected fixed in
rubygems secure_headers
>=6.0.0, <6.2.0
>=5.0.0, <5.1.0
<3.8.0
6.2.0
5.1.0
3.8.0

Affected products

  • Twitter secure_headers

Classification

Weakness
  • CWE-95 Improper Neutralization of Directives in Dynamically Evaluated Code
  • CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.