Security advisory
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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2020-5217
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 11:29 UTC · Revision 1
Source evidence
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.
osv:CVE-2020-5217
Complete source record
{
"id": "64fc851412e1297b5498d8222365781a291991b8991143559342e6930ea32ffa",
"url": "https://osv.dev/vulnerability/CVE-2020-5217",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "CVE-2020-5217",
"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.",
"evidence": "osv:CVE-2020-5217",
"products": [],
"severity": "medium",
"structured": {
"id": "CVE-2020-5217",
"aliases": [
"CVE-2020-5217",
"GHSA-xq52-rv6w-397c"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/github/secure_headers",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "0c8f0968f292ef699ac997b2085fe8ca6e87e621"
},
{
"fixed": "40e45a1a69362f8839d34e0fe16a5750330f4c5f"
},
{
"introduced": "eb9af0be9ec9447ddfffd89f4d2ca8ccd350bbd3"
},
{
"fixed": "1298905068931621a2c1988b175a1da186bcd641"
},
{
"fixed": "936a160e3e9659737a9f9eafce13eea36b5c9fa3"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:twitter:secure_headers:*:*:*:*:*:ruby:*:*",
"range": [
{
"introduced": "0"
},
{
"fixed": "3.8.0"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:twitter:secure_headers:*:*:*:*:*:ruby:*:*",
"range": [
{
"introduced": "5.0.0"
},
{
"fixed": "5.1.0"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:twitter:secure_headers:*:*:*:*:*:ruby:*:*",
"range": [
{
"introduced": "6.0.0"
},
{
"fixed": "6.2.0"
}
],
"source": "CPE_RANGE"
},
{
"range": [
{
"fixed": "936a160e3e9659737a9f9eafce13eea36b5c9fa3"
}
],
"source": "REFERENCES_COMMIT"
}
]
}
}
],
"versions": [
"v3.7.4",
"v5.0.5",
"v3.7.3",
"v6.1.2",
"v6.1.1",
"v6.1.0",
"v6.0.0.alpha03",
"v6.0.0.alpha02",
"v6.0.0.alpha01",
"v5.0.4",
"v5.0.3",
"v5.0.2",
"v5.0.1",
"v4.0.1",
"v3.7.2",
"v5.0.0.alpha01",
"v3.7.1",
"v4.0.0",
"v4.0.0.alpha04",
"v3.7.0",
"v3.6.7",
"v4.0.0.alpha03",
"v4.0.0.alpha02",
"v4.0.0.alpha01",
"v3.6.5",
"v3.6.4",
"v3.6.3",
"v3.6.1",
"v3.6.0",
"v3.5.1",
"v3.5.0",
"v3.5.0.pre",
"v3.4.1",
"v3.4.0",
"v3.3.2",
"v3.3.1",
"v3.3.0",
"v3.2.0",
"v3.1.2",
"v3.1.1",
"v3.1.0",
"v3.0.3",
"v3.0.2",
"v3.0.1",
"v3.0.0",
"v3.0.0.rc1",
"2.4.4",
"2.4.3",
"2.4.2",
"2.4.1",
"2.4.0",
"2.3.0",
"2.2.4",
"2.2.3",
"2.2.2",
"2.2.1",
"2.2.0",
"v2.1.0",
"v2.0.2",
"v2.0.1",
"2.0.0",
"v.2.0.0.pre2",
"v1.3.4",
"v2.0.0.pre",
"v1.3.3",
"v1.3.2",
"v1.1.1",
"v0.4.3",
"v0.4.2"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2020-5217.json"
}
}
],
"modified": "2026-10-20T10:54:22.386859215Z",
"provider": "osv",
"references": [
"https://github.com/twitter/secure_headers/pull/421",
"https://github.com/twitter/secure_headers/security/advisories/GHSA-xq52-rv6w-397c",
"https://github.com/twitter/secure_headers/commit/936a160e3e9659737a9f9eafce13eea36b5c9fa3",
"https://github.com/twitter/secure_headers/issues/418"
],
"provider_metadata": {}
},
"related_cves": [
{
"value": "CVE-2020-5217",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 385223,
"published_at": "2020-01-23T03:15:10.793+00:00"
}