Cross-site Request Forgery (CSRF) Affecting better_errors package, versions <2.8.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.17% (55th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Cross-site Request Forgery (CSRF) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-RUBY-BETTERERRORS-1583446
  • published8 Sept 2021
  • disclosed7 Sept 2021
  • creditUnknown

Introduced: 7 Sep 2021

CVE-2021-39197  (opens in a new tab)
CWE-352  (opens in a new tab)

How to fix?

Upgrade better_errors to version 2.8.0 or higher.

Overview

better_errors is a package that provides a better error page for Rails and other Rack apps. Includes source code inspection, a live REPL and local/instance variable inspection for all stack frames.

Affected versions of this package are vulnerable to Cross-site Request Forgery (CSRF) better_errors 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).

References

CVSS Scores

version 3.1