Skip to content
Heist/ feed
Back to feed
High

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-39197

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-39197
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 11:53 UTC · Revision 1

Source evidence

CVE-2021-39197

core-osv · Original source

Published 7 Sept 2021, 18:15 UTC

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.

osv:CVE-2021-39197
Complete source record
{
  "id": "1a275fd8288d85ab86a972d89cc5397a15cafff0342edc2900b8f3275634494c",
  "url": "https://osv.dev/vulnerability/CVE-2021-39197",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-39197",
    "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.",
    "evidence": "osv:CVE-2021-39197",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2021-39197",
      "aliases": [
        "CVE-2021-39197",
        "GHSA-w3j4-76qw-wwjm"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/bettererrors/better_errors",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "39395368110c8fac4374c813f7f0d3cd3888f973"
                },
                {
                  "fixed": "8e8e796bfbde4aa088741823c8a3fc6df2089bb0"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:better_errors_project:better_errors:*:*:*:*:*:ruby:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "2.8.0"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "8e8e796bfbde4aa088741823c8a3fc6df2089bb0"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v2.7.1",
            "v2.7.0",
            "v2.6.0",
            "v2.5.1",
            "v2.5.0",
            "v2.4.0",
            "v2.3.0",
            "v2.2.0",
            "v2.1.1",
            "v2.1.0",
            "v2.0.0",
            "v1.1.0",
            "v1.0.1",
            "v1.0.0",
            "v1.0.0.rc1",
            "v0.9.0",
            "v0.8.0",
            "v0.7.2",
            "v0.7.0",
            "v0.6.0",
            "v0.5.0",
            "v0.3.2",
            "v0.3.0",
            "v0.2.0",
            "v0.1.1",
            "v0.1.0",
            "v0.0.8",
            "v0.0.7",
            "v0.0.6",
            "v0.0.5",
            "v0.0.4",
            "v0.0.3",
            "v0.0.2",
            "v0.0.1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-39197.json"
          }
        }
      ],
      "modified": "2026-10-20T10:54:53.779027512Z",
      "provider": "osv",
      "references": [
        "https://github.com/BetterErrors/better_errors/discussions/507",
        "https://github.com/BetterErrors/better_errors/security/advisories/GHSA-w3j4-76qw-wwjm",
        "https://github.com/BetterErrors/better_errors/commit/8e8e796bfbde4aa088741823c8a3fc6df2089bb0",
        "https://github.com/BetterErrors/better_errors/pull/474"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2021-39197",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 386398,
  "published_at": "2021-09-07T18:15:07.473+00:00"
}