CVE-2021-39197Cross-Site Request Forgery in better_errors
- 6.3MediumCVSS base score
- 0.64%Exploitation in 30 daysEPSS · top 49% of all CVEs
- NoKnown exploitednot in CISA's KEV catalog
- NonePublic exploitsnone known yet
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 "~> 2.8.3". There are no known workarounds to mitigate the risk of using older releases of better_errors.
Timeline
ID reserved
By GitHub_M
- 22 days later
· 22 days later
Published
- 3 years later
· 3 years later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| GitHub_MCNA (assigner) | 3.1 | Medium6.3 | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:N/A:N |
| NVDNVD · Modified | 3.1 | High8.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
- EPSS (exploitation in 30 days)
- 0.64% · top 49% of all CVEs (18 Nov 2026)
The list uses the assigner's score when there is one, then CISA's, then NVD's: Medium 6.3.
Affected products
- affected < 2.8.0
Affected packages
From reviewed advisories of the GitHub Advisory Database.
- RubyGemsbetter_errorsGHSA-w3j4-76qw-wwjm (opens in a new tab)
References
References4
- https://github.com/BetterErrors/better_errors/security/advisories/GHSA-w3j4-76qw-wwjm (opens in a new tab)x_refsource_CONFIRMx_transferred
- https://github.com/BetterErrors/better_errors/pull/474 (opens in a new tab)x_refsource_MISCx_transferred
- https://github.com/BetterErrors/better_errors/commit/8e8e796bfbde4aa088741823c8a3fc6df2089bb0 (opens in a new tab)x_refsource_MISCx_transferred
- https://github.com/BetterErrors/better_errors/discussions/507 (opens in a new tab)x_refsource_MISCx_transferred
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- EUVD EUVD-2021-2122 (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisory GHSA-w3j4-76qw-wwjm (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://cveledger.app/cve/CVE-2021-39197)Record last updated .