Loading...
Skip to main content

CVE-2021-39197 — Vulnerability in better_errors — CVE Details

MEDIUM

Older releases of better_errors open to Cross-Site Request Forgery attack

Published September 7, 2021Updated July 8, 2026Source: osv

Summary

### Impact 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)._ ### Patches 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". ### Workarounds There are no known workarounds to mitigate the risk of using older releases of better_errors. ### References - Chris Moberly provided [an example attack that uses a now-patched vulnerability of webpack-dev-server in conjunction with Better Errors](https://about.gitlab.com/blog/2021/09/07/why-are-developers-vulnerable-to-driveby-attacks/) ### For more information If you have any questions or comments about this advisory, please - Add to the [discussion in better_errors](https://github.com/BetterErrors/better_errors/discussions/507) - Open an issue in [better_errors](https://github.com/BetterErrors/better_errors)

Advisory Timeline

  • First published September 7, 2021 (1861 days ago).
  • Last revised July 8, 2026 — 1764 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Bundler
Update better_errors to 2.8.0 or later
gem install better_errors -v 2.8.0

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: rubygems (1).

PackageEcosystemAffectedFixed In
better_errors
rubygems
0.0.1, 0.0.2, 0.0.3, 0.0.4 (+30 more)2.8.0

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-352
    Cross-Site Request Forgery (CSRF)MITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 6.3 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
High
Privileges Required
Low
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
None
Availability
None

CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:N/A:N

Frequently Asked Questions

What is CVE-2021-39197?
Older releases of better_errors open to Cross-Site Request Forgery attack This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.3/10).
How do I check if my project is affected by CVE-2021-39197?
CVE-2021-39197 affects better_errors. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2021-39197 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
6.3

Exploitation requires specific conditions or has limited impact. Remediate within weeks.

Also Known As

GHSA-w3j4-76qw-wwjm

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies