Skip to content

fix(deps): bump dd-trace to 6.23.0 and 5.134.0 for CVE-2026-116693 - #859

Closed
dirkluijk wants to merge 3 commits into
DataDog:mainfrom
dirkluijk:fix/dd-trace-cve-2026-116693
Closed

dirkluijk wants to merge 3 commits into
DataDog:mainfrom
dirkluijk:fix/dd-trace-cve-2026-116693

Conversation

@dirkluijk

@dirkluijk dirkluijk commented Nov 4, 2026 •

Copy link
Copy Markdown

What does this PR do?

Updates both dd-trace version lines used by the Node.js Lambda layers. It bumps the v6 development dependency and peer range to 6.23.0, the v5 peer range and layer pin to 5.134.0, regenerates yarn.lock, and recaptures the local integration snapshots.

It also drops the import-in-the-middle 3.4.0 resolution. Both dd-trace versions pin 3.5.3 exactly, and the resolution would otherwise force the layers onto 3.4.0.

Motivation

CVE-2026-116693 affects dd-trace before 5.131.1 and 6.20.1. Layer v12.143.0 bundles 5.126.0 for Node 18/20 and 6.15.0 for Node 22+. Customers cannot update the tracer bundled in the layer themselves.

Testing Guidelines

Locally on macOS arm64 with Docker: yarn build, yarn lint, and yarn test pass (54 suites, 732 tests). scripts/check_dd_trace_v5_pin.sh and scripts/test_install_deps.sh pass; Node 20 pins 5.134.0. Comparison-only runs of ./integration_tests_local/run.sh pass for Node 18, 20, 22, 24, and 26.

The local Docker VM has 2 CPUs, so I lowered run.sh's --cpus 4 to 2 locally without committing it. This changes the observed proactive-init workerCount to 2 on Node 22 and 24; the committed snapshots retain the value 4 from main.

Additional Notes

This supersedes #858: that PR drops v5 from the peer range, causing Node 18/20 ERESOLVE failures; leaves the v5 layer pin at vulnerable 5.126.0; and does not update the local integration snapshots. The snapshot changes here are the _dd.sdk.otlp_export tag and a monitored frame in error stacks. Other diff lines are RIE log reordering, which the comparison ignores.

I could not run the AWS end-to-end suite or GitLab layer publishing jobs. A Datadog member needs to run those pipelines. Please release updated layers after merge.

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)

dd-trace before 6.20.1 and 5.131.1 is affected by a ReDoS in the default
query string obfuscation regex (GHSA-x94g-w73q-hpcw). Bump the v6 range in
package.json and the hand-maintained v5 pin used for the Node 18 and 20
layers, and keep peerDependencies advertising both lines.

Recapture the local integration snapshots. The newer tracers add the
`_dd.sdk.otlp_export` span tag and a `monitored` frame from the dd-trace
Lambda handler to error stacks.
@dirkluijk
dirkluijk requested a review from a team as a code owner November 4, 2026 16:26

@datadog-prod-us1-5 datadog-prod-us1-5 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: WARN

Release layers force import-in-the-middle 3.4.0 despite upgraded dd-trace requiring 3.5.3. Local integration fixtures install a different loader combination, leaving compatibility of the shipped combination unverified; runtime breakage has not been established.

Open Bits AI session

🤖 Bits Code Review · Commit 851dfbf

Comment thread yarn.lock Outdated
integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==

import-in-the-middle@3.4.0, import-in-the-middle@^3.3.2:
import-in-the-middle@3.4.0, import-in-the-middle@3.5.3:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Align the loader override with upgraded dd-trace

For Node 22+ release layers, dd-trace 6.23.0 requests exactly import-in-the-middle 3.5.3, but package.json's resolution forces Yarn to install 3.4.0. The local integration Dockerfiles use npm, which ignores that resolution, so passing snapshots do not validate the loader combination actually shipped. ESM instrumentation compatibility remains uncertain. Update or remove the package.json override and regenerate yarn.lock, or explicitly verify compatibility before retaining it.

React: 👍 useful · 👎 wrong · 😕 unclear · 👀 right, but not acting on it

What each reaction means
  • 👍 Useful: correct, and you're fixing it or will.
  • 👎 Wrong: the finding is incorrect, for example the bug can't happen or the code was misread.
  • 😕 Unclear: you can't tell what it means or why it matters.
  • 👀 Right, not acting: correct, but intended, out of scope for this PR, a known risk, or too minor.

🤖 Bits Code Review · Open Bits AI session

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. The 3.4.0 resolution came from #835, which mirrored dd-trace-js pinning import-in-the-middle to 3.4.0 after 3.5.0 broke esbuild. import-in-the-middle 3.5.1 fixed that, and dd-trace-js has pinned 3.5.1 since 6.16.0 and 3.5.3 since 6.23.0 and 5.134.0. With both dd-trace lines pinning an exact version, the resolution no longer guards against yarn upgrade drift; it only forces an older version than the one dd-trace is tested with.

I removed the resolution in 554e123. Layers built from the Dockerfile for Node 20 and 22 now ship import-in-the-middle 3.5.3 alongside dd-trace 5.134.0 and 6.23.0. The local integration runs install through npm and already used 3.5.3, so they now cover what the layer ships.

The resolution mirrored a pin in dd-trace-js after import-in-the-middle
3.5.0 broke esbuild. 3.5.1 fixed that, and dd-trace 6.23.0 and 5.134.0
both pin import-in-the-middle 3.5.3 exactly. Forcing 3.4.0 would ship the
layers with an older version than the one dd-trace is tested against.
@mraalten

mraalten commented Nov 4, 2026

Copy link
Copy Markdown

We're affected by this as well (Node 24 Lambdas, layer 143) and can't patch the bundled tracer ourselves. Would appreciate a release with updated layers after merge.

Thanks.

@pablomartinezbernardo pablomartinezbernardo left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, I upgraded to the latest versions, follow #860

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants