LiveActive security incident?Get immediate response
CVE Record

CVE-2021-39197: Cross-Site Request Forgery in better_errors

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.

MediumCVSS 6.3Not KEV-listedUpdated
Glexia's TakeAutomated analysismoderate

Security readout for executives and security teams

Plain-English summary

better_errors, a Rails/Rack developer error page, could accept cross-origin internal requests before 2.8.0 because CSRF checks and strict Content-Type validation were missing. If exposed, an attacker could abuse reachable diagnostic functionality to access sensitive error-page information. Vendor guidance says the gem should normally be development-only.

Executive priority

Treat this as a configuration-sensitive medium issue. It is not known exploited, but exposed developer diagnostics can contain sensitive data. Prioritize confirming production absence and upgrading developer environments during normal vulnerability remediation.

Technical view

Affected better_errors versions below 2.8.0 lacked CSRF protection for internal requests and did not enforce the intended Content-Type, allowing cross-origin simple requests without CORS preflight. The advisory maps this to CWE-352 and CVSS 6.3. Release 2.8.x adds CSRF enforcement.

Likely exposure

Most exposure should be development or non-production Rack/Rails environments that include better_errors outside the development bundle group or expose development services to a network. Production exposure is not established by the sources, but misconfiguration could raise risk.

Exploitation context

The provided sources do not report active exploitation, and this CVE is not listed as KEV. Risk depends on better_errors being enabled and reachable where a cross-origin request can interact with its internal endpoints.

Researcher notes

The key technical issue is CSRF exposure combined with missing Content-Type enforcement, enabling cross-origin simple requests. Sources identify no workaround for safely using older releases. Validation should focus on dependency version, runtime loading scope, and network reachability.

Mitigation direction

  • Upgrade better_errors to the latest release, or at minimum the advised 2.8.x line.
  • Ensure better_errors is limited to the development bundle group or equivalent non-Rails development-only configuration.
  • Remove or disable better_errors from production and shared network environments.
  • Check current vendor guidance for any later maintenance recommendations.

Validation and detection

  • Inventory Gemfile, lockfiles, and Rack middleware for better_errors versions below 2.8.0.
  • Confirm better_errors is scoped to development-only dependencies and not loaded in production.
  • Review deployed environments for accidental exposure of development error pages.
  • Verify upgraded applications use better_errors 2.8.x or later.
Prepared
Confidence
high
Sources
5

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · medium confidence lookup

CWE-352: User-session and phishing behavior lookup

Client-side and session-facing weaknesses should be reviewed alongside initial-access and user-execution behaviors. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2021-39197 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
Medium
CVSS
6.3 (3.1)
Known Exploited
No
Published

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

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
5Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
6.3CVSS 3.1MediumCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:N/A:N1.84Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

6.3Medium
CVSS 3.1 vector shape for CVE-2021-39197Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

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

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
BetterErrorsbetter_errors< 2.8.0Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-352 · source CWE mapping

Cross-Site Request Forgery (CSRF)

Cross-Site Request Forgery (CSRF) represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.