CVE-2023-50249: @sentry/astro Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-x3v3-8xg8-8v72
CVSS 7.5
CWE-400 CWE-1333
Published
Advisory Summary

CVE-2023-50249 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting @sentry/astro libraries in the npm ecosystem. The issue involves sentry's astro sdk vulnerable to redos. Remediation is available by upgrading affected packages to version 7.87.0.

CVE-2023-50249 at a Glance

CVE Identifier CVE-2023-50249
GHSA Identifier GHSA-x3v3-8xg8-8v72
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product @sentry/astro
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2023-50249

To remediate this vulnerability, upgrade all affected @sentry/astro dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@sentry/astro fixed: 7.87.0
npm install @sentry/astro@7.87.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @sentry/astro

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2023-50249, inspect your project dependencies using npm:

npm ls @sentry/astro

Analyze the terminal output to locate any version of @sentry/astro in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.87.0), your application is affected.

Note: The npm ls @sentry/astro command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In @sentry/astro, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact A ReDoS (Regular expression Denial of Service) vulnerability has been identified in Sentry's Astro SDK 7.78.0-7.86.0. Under certain conditions, this vulnerability allows an attacker to cause excessive computation times on the server, leading to denial of service (DoS). Applications that are using Sentry's Astro SDK are affected if: 1. They're using Sentry instrumentation: - they have [manually registered](https://docs.sentry.io/platforms/javascript/guides/astro/manual-setup/#manually-add-server-instrumentation) Sentry Middleware (affected versions 7.78.0-7.86.0); - or [configured](https://docs.sentry.io/platforms/javascript/guides/astro/manual-setup/#configure-server-instrumentation) Astro in SSR (server) or hybrid mode, use Astro 3.5.0 and newer and didn’t [disable the automatic server instrumentation](https://docs.sentry.io/platforms/javascript/guides/astro/manual-setup/#disable-auto-server-instrumentation) (affected versions 7.82.0-7.86.0). 2. They have configured routes with at least two path params (e.g. `/foo/[p1]/bar/[p2]`). ### Patches The problem has been patched in [@sentry/astro@7.87.0](https://www.npmjs.com/package/@sentry/astro/v/7.87.0). The corresponding PR: https://github.com/getsentry/sentry-javascript/pull/9815 ### Workarounds We strongly recommend upgrading to the latest SDK version. However, if it's not possible, the steps to mitigate the vulnerability without upgrade are: * [disable auto instrumentation](https://docs.sentry.io/platforms/javascript/guides/astro/manual-setup/#disable-auto-server-instrumentation) if you're using Astro 3.5.0 or newer * and remove the manually added Sentry middleware (if it was [added](https://docs.sentry.io/platforms/javascript/guides/astro/manual-setup/#manually-add-server-instrumentation) before). After these changes, Sentry error reporting will still be functional, but some details such as server-side transactions (and consequently, distributed traces between client and server) will be omitted. We therefore still recommend to update to 7.87.0 as soon as you can. ### References * [Sentry docs: Manual Setup for Astro](https://docs.sentry.io/platforms/javascript/guides/astro/manual-setup/) * [Release notes: sentry-javascript 7.87.0](https://github.com/getsentry/sentry-javascript/releases/tag/7.87.0) * [npm: @sentry/astro@7.87.0](https://www.npmjs.com/package/@sentry/astro/v/7.87.0)

CVE-2023-50249 Affected @sentry/astro Versions

1 component(s)
Fixed Versions:
7.87.0
Product / Package Ecosystem Affected Versions Fixed Version
@sentry/astro
npm
≥ 7.78.0
< 7.87.0
7.87.0

References

Frequently Asked Questions

What is CVE-2023-50249?
CVE-2023-50249 is a security vulnerability in @sentry/astro involving Sentry's Astro SDK vulnerable to ReDoS under CWE-400: Uncontrolled Resource Consumption.
Which @sentry/astro versions are affected?
Affected versions include releases prior to 7.87.0 across affected packages: @sentry/astro.
What version fixes CVE-2023-50249?
Upgrading to 7.87.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @sentry/astro affected?
Yes, @sentry/astro is affected in releases prior to 7.87.0. Upgrade your dependency to 7.87.0 or later.
What is the CVSS score of CVE-2023-50249?
CVE-2023-50249 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2023-50249?
CVE-2023-50249 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check npm dependencies for CVE-2023-50249?
Run the dependency tree command: 'npm ls @sentry/astro'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-x3v3-8xg8-8v72",
  "modified" : "2023-12-28T22:03:19Z",
  "published" : "2023-12-18T20:00:55Z",
  "aliases" : [ "CVE-2023-50249" ],
  "summary" : "Sentry's Astro SDK vulnerable to ReDoS",
  "details" : "### Impact\nA ReDoS (Regular expression Denial of Service) vulnerability has been identified in Sentry's Astro SDK 7.78.0-7.86.0. Under certain conditions, this vulnerability allows an attacker to cause excessive computation times on the server, leading to denial of service (DoS).\n\nApplications that are using Sentry's Astro SDK are affected if:\n\n1. They're using Sentry instrumentation:\n   - they have [manually registered](https://docs.sentry.io/platforms/javascript/guides/astro/manual-setup/#manually-add-server-instrumentation) Sentry Middleware (affected versions 7.78.0-7.86.0);\n   - or [configured](https://docs.sentry.io/platforms/javascript/guides/astro/manual-setup/#configure-server-instrumentation) Astro in SSR (server) or hybrid mode, use Astro 3.5.0 and newer and didn’t [disable the automatic server instrumentation](https://docs.sentry.io/platforms/javascript/guides/astro/manual-setup/#disable-auto-server-instrumentation) (affected versions 7.82.0-7.86.0).\n2. They have configured routes with at least two path params (e.g. `/foo/[p1]/bar/[p2]`).\n\n### Patches\nThe problem has been patched in [@sentry/astro@7.87.0](https://www.npmjs.com/package/@sentry/astro/v/7.87.0).\nThe corresponding PR: https://github.com/getsentry/sentry-javascript/pull/9815\n\n### Workarounds\nWe strongly recommend upgrading to the latest SDK version. However, if it's not possible, the steps to mitigate the vulnerability without upgrade are:\n* [disable auto instrumentation](https://docs.sentry.io/platforms/javascript/guides/astro/manual-setup/#disable-auto-server-instrumentation) if you're using Astro 3.5.0 or newer\n* and remove the manually added Sentry middleware (if it was [added](https://docs.sentry.io/platforms/javascript/guides/astro/manual-setup/#manually-add-server-instrumentation) before).\n\nAfter these changes, Sentry error reporting will still be functional, but some details such as server-side transactions (and consequently, distributed traces between client and server) will be omitted. We therefore still recommend to update to 7.87.0 as soon as you can. \n\n### References\n* [Sentry docs: Manual Setup for Astro](https://docs.sentry.io/platforms/javascript/guides/astro/manual-setup/)\n* [Release notes: sentry-javascript 7.87.0](https://github.com/getsentry/sentry-javascript/releases/tag/7.87.0)\n* [npm: @sentry/astro@7.87.0](https://www.npmjs.com/package/@sentry/astro/v/7.87.0)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@sentry/astro"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.78.0"
      }, {
        "fixed" : "7.87.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/getsentry/sentry-javascript/security/advisories/GHSA-x3v3-8xg8-8v72"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-50249"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getsentry/sentry-javascript/pull/9815"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getsentry/sentry-javascript/commit/fe24eb5eefa9d27b14b2b6f9ebd1debca1c208fb"
  }, {
    "type" : "WEB",
    "url" : "https://docs.sentry.io/platforms/javascript/guides/astro/manual-setup/#disable-auto-server-instrumentation"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/getsentry/sentry-javascript"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/package/@sentry/astro/v/7.87.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333", "CWE-400" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-12-18T20:00:55Z",
    "nvd_published_at" : "2023-12-20T14:15:21Z"
  }
}