Packages / @sentry/node / Security

LowVulnerabilityGHSA-r5w7-f542-q2j4Published 28 Jan 2025

Potential DoS when using ContextLines integration

Your version

Affected releases · @sentry/node

  • 8.x8.10.0 – 8.48.0Fixed in 8.49.0

On 8.x, the newest line:

npm install @sentry/node@8.49.0
Every release on a timeline
11.x
  1. Not affected

    11.0.0 – 11.9.0

    10 releases, latest

8.x
  1. Not affected

    8.0.0 – 8.9.2

    13 releases

  2. Affected

    8.10.0 – 8.48.0

    42 releases

  3. Fixed

    8.49.0 – 8.55.2

    10 releases

578 stable releases of @sentry/node, oldest to newest, one row per major.

What happens

Impact

The ContextLines integration uses readable streams to more efficiently use memory when reading files. The ContextLines integration is used to attach source context to outgoing events.

The stream was not explicitly closed after use. This could lead to excessive amounts of file handles open on the system and potentially lead to a Denial of Service (DoS).

The ContextLines integration is enabled by default in the Node SDK (@sentry/node) and SDKs that run in Node.js environments (@sentry/astro, @sentry/aws-serverless, @sentry/bun, @sentry/google-cloud-serverless, @sentry/nestjs, @sentry/nextjs, @sentry/nuxt, @sentry/remix, @sentry/solidstart, @sentry/sveltekit).

Patches

Users should upgrade to version 8.49.0 or higher.

Workarounds

To remediate this issue in affected versions without upgrading to version 8.49.0 and above you can disable the ContextLines integration. See the docs for more details.

Sentry.init({
  // ...
  integrations: function (integrations) {
    // integrations will be all default integrations
    return integrations.filter(function (integration) {
      return integration.name !== "ContextLines";
    });
  },
});

If you disable the ContextLines integration, you will lose source context on your error events.

References