GHSA-r5w7-f542-q2j4: Potential DoS when using ContextLines integration
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).
Published Jan 28, 2025
Affected packages
@sentry/node
- Ecosystem
- npm
- Affected
- >= 8.10.0, < 8.49.0
- Fixed in
- 8.49.0
- Check
npm ls @sentry/node
@sentry/astro
- Ecosystem
- npm
- Affected
- >= 8.10.0, < 8.49.0
- Fixed in
- 8.49.0
- Check
npm ls @sentry/astro
@sentry/aws-serverless
- Ecosystem
- npm
- Affected
- >= 8.10.0, < 8.49.0
- Fixed in
- 8.49.0
- Check
npm ls @sentry/aws-serverless
@sentry/bun
- Ecosystem
- npm
- Affected
- >= 8.10.0, < 8.49.0
- Fixed in
- 8.49.0
- Check
npm ls @sentry/bun
@sentry/google-cloud-serverless
- Ecosystem
- npm
- Affected
- >= 8.10.0, < 8.49.0
- Fixed in
- 8.49.0
- Check
npm ls @sentry/google-cloud-serverless
@sentry/nestjs
- Ecosystem
- npm
- Affected
- >= 8.10.0, < 8.49.0
- Fixed in
- 8.49.0
- Check
npm ls @sentry/nestjs
@sentry/nextjs
- Ecosystem
- npm
- Affected
- >= 8.10.0, < 8.49.0
- Fixed in
- 8.49.0
- Check
npm ls @sentry/nextjs
@sentry/nuxt
- Ecosystem
- npm
- Affected
- >= 8.10.0, < 8.49.0
- Fixed in
- 8.49.0
- Check
npm ls @sentry/nuxt
@sentry/remix
- Ecosystem
- npm
- Affected
- >= 8.10.0, < 8.49.0
- Fixed in
- 8.49.0
- Check
npm ls @sentry/remix
@sentry/solidstart
- Ecosystem
- npm
- Affected
- >= 8.10.0, < 8.49.0
- Fixed in
- 8.49.0
- Check
npm ls @sentry/solidstart
@sentry/sveltekit
- Ecosystem
- npm
- Affected
- >= 8.10.0, < 8.49.0
- Fixed in
- 8.49.0
- Check
npm ls @sentry/sveltekit
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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
Credited to mstrokin.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
