{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2020-5217","id":"CVE-2020-5217","title":"Directive injection when using dynamic overrides with user input in RubyGems secure_headers","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 w","descriptionLong":"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-23T02:15:17.000Z","updated":"2026-10-20T10:54:22.386859215Z","reserved":"2020-01-02T00:00:00.000Z","status":"Modified","rejected":false,"assigner":"GitHub_M","metric":{"version":"3.1","score":4.4,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N","rating":"medium","source":"GitHub_M"},"metrics":[{"version":"3.1","score":4.4,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N","rating":"medium","source":"GitHub_M"},{"version":"3.1","score":4.4,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N","rating":"medium","source":"github.com"},{"version":"3.1","score":5.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N","rating":"medium","source":"NVD"},{"version":"3.1","score":5.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N","rating":"medium","source":"OSV"},{"version":"3.1","score":4.4,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N","rating":"medium","source":"GitHub"},{"version":"2.0","score":5,"vector":"AV:N/AC:L/Au:N/C:N/I:P/A:N","rating":"medium","source":"NVD"}],"rating":"medium","products":["Twitter secure_headers"],"affectedProducts":[{"vendor":"Twitter","product":"secure_headers","defaultStatus":null,"versions":[{"status":"affected","version":"< 3.8.0"},{"status":"affected","version":">= 5.0.0, < 5.1.0"},{"status":"affected","version":">= 6.0.0, < 6.2.0"}],"platforms":[]}],"packages":[{"ecosystem":"RubyGems","name":"secure_headers","purl":"pkg:gem/secure_headers","ranges":[">=6.0.0 <6.2.0",">=5.0.0 <5.1.0","<3.8.0"],"fixed":["6.2.0","5.1.0","3.8.0"],"advisory":"GHSA-xq52-rv6w-397c"}],"cwes":["CWE-95","CWE-74"],"aliases":["GHSA-xq52-rv6w-397c"],"references":[{"url":"https://github.com/twitter/secure_headers/security/advisories/GHSA-xq52-rv6w-397c","tags":["x_refsource_CONFIRM","x_transferred","Mitigation","Third Party Advisory","advisory","web"]},{"url":"https://github.com/twitter/secure_headers/issues/418","tags":["x_refsource_MISC","x_transferred","Exploit","Third Party Advisory","evidence","web"]},{"url":"https://github.com/twitter/secure_headers/pull/421","tags":["x_refsource_MISC","x_transferred","Third Party Advisory","advisory","web"]},{"url":"https://github.com/twitter/secure_headers/commit/936a160e3e9659737a9f9eafce13eea36b5c9fa3","tags":["x_refsource_MISC","x_transferred","Patch","fix","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2020-5217","tags":["advisory"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/secure_headers/CVE-2020-5217.yml","tags":["web"]},{"url":"https://github.com/twitter/secure_headers","tags":["package"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":true,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":null,"epss":0.0183,"epssPercentile":0.79289,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2020-5217","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2020-5217","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2020-5217","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-xq52-rv6w-397c","ok":true,"note":"GHSA-xq52-rv6w-397c"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2020-5217","ok":true,"note":"scored 2026-11-18"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}