5.8

CVE-2020-5217: Directive injection when using dynamic overrides with user input in RubyGems secure_headers

Modified
AliasesUBUNTU-CVE-2020-5217DEBIAN-CVE-2020-5217GHSA-xq52-rv6w-397c
Published 23-01-2020Last modified 04-08-2024

Vulnerability summary

CVE-2020-5217 is a medium (CVSS 5.8) vulnerability in twitter secure_headers. EPSS estimates a 1.83% chance of exploitation in the next 30 days, higher than 78.8% of scored vulnerabilities. 1 public exploit is recorded.

Priority
Routine

Not severe (CVSS 4.4, network access); no exploitation reported by the 5 checked sources

Source freshness unavailable

How is this decided?
CVSS score
5.8/10
010
Medium · v3.1 (NVD)
EPSS score
1.83%
0%100%
Low · 0.00 pp in 30 days
KEVNot listedNot listed by any tracked catalog.
RansomwareNot flaggedNo ransomware use recorded.
Public exploits1github

Advisory lineage

Upstream 0 · Downstream 1

Timeline

  1. 23-01-2020
    PublishedVulnerability first disclosed.
  2. 04-08-2024
    Last modifiedVulnerability information updated.

Description

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.

CVSS metrics

6 scores · 5 sources · 2 versions

EPSS trend

Probability

1.83%

Chance of exploitation in the next 30 days

Percentile

79%

Versus all other CVEs

30-day change

No change 0.00 pp

From 1.83% on 04-10-2026

04-10-202603-11-2026

Known exploited

Compare KEV catalogs
CISA KEV

Not in the CISA KEV catalog.

ENISA CNW

Not in the ENISA CNW catalog.

CIRCL

Not in the CIRCL catalog.

Public exploits

1 found
  • githubUnverified

    Secure Headers

    Maturity: poc

Weaknesses

CWE · root cause

Affected systems

Version check

Known conditions: network-reachable, low-privilege account, user interaction (CVSS vector). Other conditions: not stated in public data.

Debian1 product
  • ruby-secure-headers< 6.3.1-1
RubyGems1 product
  • secure_headers≥ 6.0.0, < 6.2.0 | ≥ 5.0.0, < 5.1.0 | < 3.8.0
Twitter1 product
Ubuntu1 product
  • ruby-secure-headersAll versions (No fix recorded)

4 vendors · 4 products

References

10 links