{"answers":{"affected":"2 open source packages ship an affected version, including better_errors. It affects 1 product.","exploited":"There is no known exploitation of CVE-2021-39197 in the wild and no public exploit code.","fix":"Upgrade better_errors to 2.8.0 or later.","what":"CVE-2021-39197 is a medium-severity vulnerability in BetterErrors better_errors, published on 7 Sep 2021."},"fix_prompt":"Check this codebase for CVE-2021-39197 and fix it if it is affected.\n\nWhat it is: CVE-2021-39197 is a medium-severity vulnerability in BetterErrors better_errors, published on 7 Sep 2021. \nExploitation: There is no known exploitation of CVE-2021-39197 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- better_errors (RubyGems): affected all versions; fixed in 2.8.0\n- better_errors (RubyGems): affected all versions; fixed in 2.8.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-2021-39197/ (Markdown: https://insights.sbomify.com/CVE-2021-39197/index.md)","id":"CVE-2021-39197","markdown":"https://insights.sbomify.com/CVE-2021-39197/index.md","name":"CVE-2021-39197","record":{"aliases":["GHSA-w3j4-76qw-wwjm"],"analysis":null,"analysis_generated_by":null,"assigner":"GitHub_M","cpe":[{"product":"better_errors","vendor":"better_errors_project"}],"cvss":{"score":6.3,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:N/A:N","version":"3.1"},"cwes":[{"id":"CWE-352","name":"Cross-Site Request Forgery"}],"description":"better_errors is an open source replacement for the standard Rails error page with more information rich error pages. It is also usable outside of Rails in any Rack app as Rack middleware. better_errors prior to 2.8.0 did not implement CSRF protection for its internal requests. It also did not enforce the correct \"Content-Type\" header for these requests, which allowed a cross-origin \"simple request\" to be made without CORS protection. These together left an application with better_errors enabled open to cross-origin attacks. As a developer tool, better_errors documentation strongly recommends addition only to the `development` bundle group, so this vulnerability should only affect development environments. Please ensure that your project limits better_errors to the `development` group (or the non-Rails equivalent). Starting with release 2.8.x, CSRF protection is enforced. It is recommended that you upgrade to the latest release, or minimally to \"~\u003e 2.8.3\". There are no known workarounds to mitigate the risk of using older releases of better_errors.","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":"Cross-Site Request Forgery in better_errors","id":"CVE-2021-39197","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"RubyGems","product":null,"products":[],"type":null,"year":"2021"},"n_packages":2,"n_references":4,"next":{"headline":"The disqualify lead action may be executed without CSRF token check","id":"CVE-2021-39198"},"packages":[{"ecosystem":"RubyGems","fixed":["2.8.0"],"introduced":["0"],"last_affected":[],"package":"better_errors","purl":null,"source":"GHSA-w3j4-76qw-wwjm"},{"ecosystem":"RubyGems","fixed":["2.8.0"],"introduced":["0"],"last_affected":[],"package":"better_errors","purl":"pkg:gem/better_errors","source":"GHSA-w3j4-76qw-wwjm"}],"prev":{"headline":"Authenticated non-privileged user can request unfiltered data without adequate permissions in pcapture","id":"CVE-2021-39196"},"products":["better_errors"],"published":"2021-09-07","related":[],"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":["BetterErrors"]},"summary":null,"url":"https://insights.sbomify.com/CVE-2021-39197/"}