{"answers":{"affected":"6 open source packages ship an affected version, including secure_headers. It affects 1 product.","exploited":"There is no known exploitation of CVE-2020-5217 in the wild and no public exploit code.","fix":"Upgrade secure_headers to a fixed version for your release line: 3.8.0, 5.1.0 or 6.2.0.","what":"CVE-2020-5217 is a medium-severity code injection vulnerability in Twitter secure_headers, published on 23 Jan 2020. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2020-5217 and fix it if it is affected.\n\nWhat it is: CVE-2020-5217 is a medium-severity code injection vulnerability in Twitter secure_headers, published on 23 Jan 2020. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2020-5217 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- secure_headers (RubyGems): affected all versions; fixed in 3.8.0\n- secure_headers (RubyGems): affected all versions; fixed in 3.8.0\n- secure_headers (RubyGems): affected from 5.0.0; fixed in 5.1.0\n- secure_headers (RubyGems): affected from 5.0.0; fixed in 5.1.0\n- secure_headers (RubyGems): affected from 6.0.0; fixed in 6.2.0\n- secure_headers (RubyGems): affected from 6.0.0; fixed in 6.2.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2020-5217/ (Markdown: https://insights.sbomify.com/CVE-2020-5217/index.md)","id":"CVE-2020-5217","markdown":"https://insights.sbomify.com/CVE-2020-5217/index.md","name":"CVE-2020-5217","record":{"aliases":["DEBIAN-CVE-2020-5217","GHSA-xq52-rv6w-397c","UBUNTU-CVE-2020-5217"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["security_bypass"],"network_reachable":"yes","non_default_config":false,"product_category":"Ruby secure_headers gem","requires_auth":"low_privilege","summary":"Attackers can inject semicolons into Content Security Policy directives via user input, potentially overriding security restrictions in applications using the secure_headers Ruby gem.","user_interaction":"required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"secure_headers","vendor":"twitter"}],"cvss":{"score":4.4,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N","version":"3.1"},"cwes":[{"id":"CWE-74","name":"Improper Neutralization of Special Elements in Output Used by a Downstream Component"},{"id":"CWE-95","name":"Improper Neutralization of Directives in Dynamically Evaluated Code"}],"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.","ecosystems":["RubyGems"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Directive injection when using dynamic overrides with user input in RubyGems secure_headers","id":"CVE-2020-5217","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"RubyGems","product":null,"products":[],"type":"code_injection","year":"2020"},"n_packages":6,"n_references":4,"next":{"headline":"Ability in Sylius to switch channels via GET parameter enabled in production environments","id":"CVE-2020-5218"},"packages":[{"ecosystem":"RubyGems","fixed":["3.8.0"],"introduced":["0"],"last_affected":[],"package":"secure_headers","purl":null,"source":"GHSA-xq52-rv6w-397c"},{"ecosystem":"RubyGems","fixed":["3.8.0"],"introduced":["0"],"last_affected":[],"package":"secure_headers","purl":"pkg:gem/secure_headers","source":"GHSA-xq52-rv6w-397c"},{"ecosystem":"RubyGems","fixed":["5.1.0"],"introduced":["5.0.0"],"last_affected":[],"package":"secure_headers","purl":null,"source":"GHSA-xq52-rv6w-397c"},{"ecosystem":"RubyGems","fixed":["5.1.0"],"introduced":["5.0.0"],"last_affected":[],"package":"secure_headers","purl":"pkg:gem/secure_headers","source":"GHSA-xq52-rv6w-397c"},{"ecosystem":"RubyGems","fixed":["6.2.0"],"introduced":["6.0.0"],"last_affected":[],"package":"secure_headers","purl":null,"source":"GHSA-xq52-rv6w-397c"},{"ecosystem":"RubyGems","fixed":["6.2.0"],"introduced":["6.0.0"],"last_affected":[],"package":"secure_headers","purl":"pkg:gem/secure_headers","source":"GHSA-xq52-rv6w-397c"}],"prev":{"headline":"Limited header injection when using dynamic overrides with user input in RubyGems secure_headers","id":"CVE-2020-5216"},"products":["secure_headers"],"published":"2020-01-23","related":[{"cvss_score":4.4,"headline":"Limited header injection when using dynamic overrides with user input in RubyGems secure_headers","id":"CVE-2020-5216","kev_date_added":null,"published":"2020-01-23"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-04","vendors":["Twitter"]},"summary":"Attackers can inject semicolons into Content Security Policy directives via user input, potentially overriding security restrictions in applications using the secure_headers Ruby gem.","url":"https://insights.sbomify.com/CVE-2020-5217/"}