Advisory

GHSA-r5w7-f542-q2j4

Also known as: None

Summary

Potential DoS when using ContextLines integration

Details

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

  • Reported issue: https://github.com/getsentry/sentry-javascript/issues/14892
  • PR Fix: https://github.com/getsentry/sentry-javascript/pull/14997

Severity

Low Basis: The source's own band: LOW

Dates

Published
2025-01-28 20:37 UTC
Modified
2025-01-28 20:37 UTC

Affected packages and fixes

11 affected packages; all npm · All systems; affected: introduced 8.10.0, fixed 8.49.0
PackageFix
@sentry/nodenpm install @sentry/[email protected]
@sentry/astronpm install @sentry/[email protected]
@sentry/aws-serverlessnpm install @sentry/[email protected]
@sentry/bunnpm install @sentry/[email protected]
@sentry/google-cloud-serverlessnpm install @sentry/[email protected]
@sentry/nestjsnpm install @sentry/[email protected]
@sentry/nextjsnpm install @sentry/[email protected]
@sentry/nuxtnpm install @sentry/[email protected]
@sentry/remixnpm install @sentry/[email protected]
@sentry/solidstartnpm install @sentry/[email protected]
@sentry/sveltekitnpm install @sentry/[email protected]

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences