{"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-5216 in the wild and no public exploit code.","fix":"Upgrade secure_headers to a fixed version for your release line: 3.9.0, 5.2.0 or 6.3.0.","what":"CVE-2020-5216 is a medium-severity 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-5216 and fix it if it is affected.\n\nWhat it is: CVE-2020-5216 is a medium-severity 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-5216 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- secure_headers (RubyGems): affected all versions; fixed in 3.9.0\n- secure_headers (RubyGems): affected all versions; fixed in 3.9.0\n- secure_headers (RubyGems): affected from 5.0.0; fixed in 5.2.0\n- secure_headers (RubyGems): affected from 5.0.0; fixed in 5.2.0\n- secure_headers (RubyGems): affected from 6.0.0; fixed in 6.3.0\n- secure_headers (RubyGems): affected from 6.0.0; fixed in 6.3.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-5216/ (Markdown: https://insights.sbomify.com/CVE-2020-5216/index.md)","id":"CVE-2020-5216","markdown":"https://insights.sbomify.com/CVE-2020-5216/index.md","name":"CVE-2020-5216","record":{"aliases":["DEBIAN-CVE-2020-5216","GHSA-w978-rmpf-qmwg","UBUNTU-CVE-2020-5216"],"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 newlines into Content-Security-Policy headers via user input, bypassing security restrictions in Ruby applications using the secure_headers gem.","user_interaction":"required","vuln_class":"other"},"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-113","name":"Improper Neutralization of CRLF Sequences in HTTP Headers"}],"description":"In Secure Headers (RubyGem secure_headers), a directive injection vulnerability is present in versions before 3.9.0, 5.2.0, and 6.3.0. If user-supplied input was passed into append/override_content_security_policy_directives, a newline could be injected leading to limited header injection. Upon seeing a newline in the header, rails will silently create a new Content-Security-Policy header with the remaining value of the original string. It will continue to create new headers for each newline. This has been fixed in 6.3.0, 5.2.0, and 3.9.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":"Limited header injection when using dynamic overrides with user input in RubyGems secure_headers","id":"CVE-2020-5216","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"RubyGems","product":null,"products":[],"type":"other","year":"2020"},"n_packages":6,"n_references":2,"next":{"headline":"Directive injection when using dynamic overrides with user input in RubyGems secure_headers","id":"CVE-2020-5217"},"packages":[{"ecosystem":"RubyGems","fixed":["3.9.0"],"introduced":["0"],"last_affected":[],"package":"secure_headers","purl":null,"source":"GHSA-w978-rmpf-qmwg"},{"ecosystem":"RubyGems","fixed":["3.9.0"],"introduced":["0"],"last_affected":[],"package":"secure_headers","purl":"pkg:gem/secure_headers","source":"GHSA-w978-rmpf-qmwg"},{"ecosystem":"RubyGems","fixed":["5.2.0"],"introduced":["5.0.0"],"last_affected":[],"package":"secure_headers","purl":null,"source":"GHSA-w978-rmpf-qmwg"},{"ecosystem":"RubyGems","fixed":["5.2.0"],"introduced":["5.0.0"],"last_affected":[],"package":"secure_headers","purl":"pkg:gem/secure_headers","source":"GHSA-w978-rmpf-qmwg"},{"ecosystem":"RubyGems","fixed":["6.3.0"],"introduced":["6.0.0"],"last_affected":[],"package":"secure_headers","purl":null,"source":"GHSA-w978-rmpf-qmwg"},{"ecosystem":"RubyGems","fixed":["6.3.0"],"introduced":["6.0.0"],"last_affected":[],"package":"secure_headers","purl":"pkg:gem/secure_headers","source":"GHSA-w978-rmpf-qmwg"}],"prev":{"headline":"Segmentation faultin TensorFlow when converting a Python string to tf.float16","id":"CVE-2020-5215"},"products":["secure_headers"],"published":"2020-01-23","related":[{"cvss_score":4.4,"headline":"Directive injection when using dynamic overrides with user input in RubyGems secure_headers","id":"CVE-2020-5217","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 newlines into Content-Security-Policy headers via user input, bypassing security restrictions in Ruby applications using the secure_headers gem.","url":"https://insights.sbomify.com/CVE-2020-5216/"}