Cross-Site Request Forgery in better_errors
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Tampering
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub. Impact type from CWE-352.
Summary
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| BetterErrors | better_errors | before 2.8.0 | 2.8.0 | Patch available | CNA |
| — | better_errors (RubyGems) | before 2.8.0 | 2.8.0 | Patch available | GHSA-w3j4-76qw-wwjm |
- better_errors VendorBetterErrors Affected before 2.8.0 Fixed in 2.8.0 Patch available CNA
- better_errors (RubyGems) Vendor— Affected before 2.8.0 Fixed in 2.8.0 Patch available GHSA-w3j4-76qw-wwjm
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:better_errors_project:better_errors:*:*:*:*:*:ruby:*:* | before 2.8.0 | Vulnerable | Better Errors Project |
- cpe:2.3:a:better_errors_project:better_errors:*:*:*:*:*:ruby:*:* Versions before 2.8.0 Vulnerable ·Better Errors Project
Remediation
- Fix · CNA better_errors (BetterErrors) Fixed in 2.8.0
- Fix · GHSA-w3j4-76qw-wwjm better_errors (RubyGems) Fixed in 2.8.0 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2021-39197
- 2026-10-03 Alias added: GHSA-w3j4-76qw-wwjm
- 2026-10-21 EPSS moved to the 50th–90th percentile
References
Patch 2
Advisory 3
Sources
- CVE-2021-39197 · CVE Program
- CVE-2021-39197 · NVD
- FIRST EPSS
- GHSA-w3j4-76qw-wwjm · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences