GHSA-r5w7-f542-q2j4 Potential DoS when using ContextLines integration

Not scored Published

An attacker can cause a Denial of Service by exhausting file handles via the ContextLines integration in the Sentry Node SDK.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is GHSA-r5w7-f542-q2j4?

GHSA-r5w7-f542-q2j4 is a denial of service vulnerability in @sentry/astro, published on 28 Jan 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

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

Which versions are affected by GHSA-r5w7-f542-q2j4?

22 open source packages ship an affected version, including @sentry/astro, @sentry/aws-serverless and @sentry/bun.

PackageAffectedFixed in
@sentry/astro npmFrom 8.10.08.49.0
@sentry/astro npmFrom 8.10.08.49.0
@sentry/aws-serverless npmFrom 8.10.08.49.0
@sentry/aws-serverless npmFrom 8.10.08.49.0
@sentry/bun npmFrom 8.10.08.49.0
@sentry/bun npmFrom 8.10.08.49.0
16 more packages
@sentry/google-cloud-serverless npmFrom 8.10.08.49.0
@sentry/google-cloud-serverless npmFrom 8.10.08.49.0
@sentry/nestjs npmFrom 8.10.08.49.0
@sentry/nestjs npmFrom 8.10.08.49.0
@sentry/nextjs npmFrom 8.10.08.49.0
@sentry/nextjs npmFrom 8.10.08.49.0
@sentry/node npmFrom 8.10.08.49.0
@sentry/node npmFrom 8.10.08.49.0
@sentry/nuxt npmFrom 8.10.08.49.0
@sentry/nuxt npmFrom 8.10.08.49.0
@sentry/remix npmFrom 8.10.08.49.0
@sentry/remix npmFrom 8.10.08.49.0
@sentry/solidstart npmFrom 8.10.08.49.0
@sentry/solidstart npmFrom 8.10.08.49.0
@sentry/sveltekit npmFrom 8.10.08.49.0
@sentry/sveltekit npmFrom 8.10.08.49.0

How do I fix GHSA-r5w7-f542-q2j4?

Upgrade @sentry/astro to 8.49.0 or later.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is GHSA-r5w7-f542-q2j4 being exploited?

There is no known exploitation of GHSA-r5w7-f542-q2j4 in the wild and no public exploit code.

Sources

Is GHSA-r5w7-f542-q2j4 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free