{"id":"CVE-2021-39197","published":"2021-09-07T17:30:11Z","modified":"2024-08-04T01:58:18Z","title":"Cross-Site Request Forgery in better_errors","vendor":"BetterErrors","product":"better_errors","tier":"tail","description":{"text":"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 \"~> 2.8.3\". There are no known workarounds to mitigate the risk of using older releases of better_errors.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.3,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:N/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00641,"percentile":0.45294,"provenance":"source"},"cwes":[{"id":"CWE-352","name":"Cross-Site Request Forgery"}],"references":[{"url":"https://github.com/BetterErrors/better_errors/security/advisories/GHSA-w3j4-76qw-wwjm","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/BetterErrors/better_errors/pull/474","tags":["x_refsource_MISC"]},{"url":"https://github.com/BetterErrors/better_errors/commit/8e8e796bfbde4aa088741823c8a3fc6df2089bb0","tags":["x_refsource_MISC"]},{"url":"https://github.com/BetterErrors/better_errors/discussions/507","tags":["x_refsource_MISC"]}],"priority":{"score":13.5,"factors":[{"name":"EPSS percentile","points":9.06},{"name":"CVSS severity","points":4.41}]},"vendorSlug":"bettererrors","affectedVersions":[{"vendor":"BetterErrors","product":"better_errors","versions":["< 2.8.0"]}],"affected":[{"ecosystem":"RubyGems","package":"better_errors","vulnerableRanges":["<2.8.0"],"patched":["2.8.0"],"from":["GHSA-w3j4-76qw-wwjm"],"provenance":"source"}],"summary":{"text":"The better_errors Rack middleware and Rails error page replacement, prior to version 2.8.0, lacks CSRF protection on its internal requests and does not enforce the correct Content-Type header for them. An attacker able to get a victim with a browser to a page they control, while the affected application runs with better_errors enabled, can make cross-origin requests to those internal endpoints without CORS protection, and the attack is only realistic if the victim's browser session is active and the attacker can induce a user to visit their page.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:35:00Z"},"euvd":{"id":"EUVD-2021-2122","exploited":false,"provenance":"source"}}