Skip to content

fix(deps): upgrade OpenTelemetry ecosystem to v2.x (CVE-2026-54285)#42000

Closed
appsmith-smithes[bot] wants to merge 6 commits into
releasefrom
fix/opentelemetry-ecosystem-v2-upgrade
Closed

fix(deps): upgrade OpenTelemetry ecosystem to v2.x (CVE-2026-54285)#42000
appsmith-smithes[bot] wants to merge 6 commits into
releasefrom
fix/opentelemetry-ecosystem-v2-upgrade

Conversation

@appsmith-smithes

@appsmith-smithes appsmith-smithes Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes CVE-2026-54285@opentelemetry/core: Unbounded memory allocation in W3C Baggage propagation (medium severity, 90-day SLA, 62d remaining).

The CVE has no v1.x patch. The fix is only available in @opentelemetry/core v2.x.

All @opentelemetry/* packages are upgraded together. The ecosystem has strict internal version alignment requirements — mixing v1.x and v2.x causes runtime crashes and TypeScript errors (this was the root cause of the previous PR #41981 which was closed).


What changed

app/client/package.json

Package Before After
@opentelemetry/core ^1.30.0 ^2.9.0
@opentelemetry/sdk-trace-base ^1.30.0 ^2.9.0
@opentelemetry/sdk-trace-web ^1.30.0 ^2.9.0
@opentelemetry/resources ^1.30.0 ^2.9.0
@opentelemetry/context-zone ^1.30.0 ^2.9.0
@opentelemetry/exporter-trace-otlp-http ^0.57.0 ^0.220.0
@opentelemetry/instrumentation ^0.57.0 ^0.220.0
@opentelemetry/semantic-conventions ^1.28.0 ^1.29.0 (resolved: 1.43.0)

All packages also added to resolutions to enforce the v2 versions across the full dependency tree.

app/client/tsconfig.json

moduleResolution: "node""bundler"

Required because semantic-conventions@1.43.0 uses the exports field in package.json for the /incubating subpath (used in src/instrumentation/index.ts). TypeScript with moduleResolution: "node" (classic) cannot resolve package.json subpath exports — "bundler" supports them.

app/client/yarn.lock

Fully regenerated with Yarn 3.5.1 in --mode=update-lockfile. All old v1.x @opentelemetry/* entries removed; v2.x entries added with correct checksums and resolved versions.


Why the previous PR (#41981) failed

PR #41981 bumped only @opentelemetry/core to v2.x while leaving all companion packages at v1.x:

  1. client-unit-tests: sdk-trace-base@1.x calls core.TracesSamplerValues.AlwaysOn — this enum was removed in core@2.x, causing a TypeError
  2. client-build: semantic-conventions@1.43.0 was added to the lockfile (for core@2.x), changing the hoisted version. TypeScript with moduleResolution: "node" then failed to resolve the /incubating subpath

Testing

  • yarn check-types should pass with moduleResolution: bundler
  • client-unit-tests should pass — all packages are now on consistent v2.x
  • Runtime: ATTR_DEPLOYMENT_NAME, ATTR_SERVICE_INSTANCE_ID, ATTR_SERVICE_NAME all verified present in semantic-conventions@1.43.0
  • TracesSamplerValues is no longer needed (it was an internal of sdk-trace-base; v2 uses a different internal API)

Resolves Dependabot alert #654

Warning

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/29494641858
Commit: 40288a1
Cypress dashboard.
Tags: @tag.All
Spec:
It seems like no tests ran 😔. We are not able to recognize it, please check workflow here.


Thu, 16 Jul 2026 11:45:28 UTC

Automation

/ok-to-test tags="@tag.All"

Fixes CVE-2026-54285 (@opentelemetry/core — unbounded memory allocation
in W3C Baggage propagation, medium severity).

The CVE has no v1.x patch; the fix is only available in v2.x.
This commit upgrades the entire @opentelemetry/* package family together
to maintain internal version alignment, which is required by the ecosystem.

Changes:
- @opentelemetry/core: ^1.30.0 → ^2.9.0
- @opentelemetry/sdk-trace-base: ^1.30.0 → ^2.9.0
- @opentelemetry/sdk-trace-web: ^1.30.0 → ^2.9.0
- @opentelemetry/resources: ^1.30.0 → ^2.9.0
- @opentelemetry/context-zone: ^1.30.0 → ^2.9.0
- @opentelemetry/exporter-trace-otlp-http: ^0.57.0 → ^0.220.0
- @opentelemetry/instrumentation: ^0.57.0 → ^0.220.0
- @opentelemetry/semantic-conventions: ^1.28.0 → ^1.29.0

Also updates tsconfig.json moduleResolution from 'node' to 'bundler' to
support the package.json subpath exports (/incubating) used by
semantic-conventions@1.43.0, which is required for TypeScript to resolve
the `@opentelemetry/semantic-conventions/incubating` import in
src/instrumentation/index.ts.

Closes security alert: Dependabot #654 (CE)
@appsmith-smithes
appsmith-smithes Bot requested a review from a team as a code owner July 15, 2026 17:46
…ons/incubating

Switching to moduleResolution: bundler broke klona/full and klona/json
subpath imports because klona's exports field maps all subpaths to the
same root types file, which TypeScript bundler mode rejects.

Correct approach:
- Keep moduleResolution: node (compatible with all existing imports)
- Add explicit TypeScript paths mapping for the one import that needs it:
  @opentelemetry/semantic-conventions/incubating → physical .d.ts file

TypeScript 'node' moduleResolution cannot resolve package.json exports
field for subpath imports. The paths mapping bypasses this by pointing
TypeScript directly to the physical declaration file at:
  node_modules/@opentelemetry/semantic-conventions/build/src/index-incubating
@appsmith-smithes

Copy link
Copy Markdown
Contributor Author

🔧 Fix pushed — commit 25fbb82

Problem: switching to moduleResolution: bundler broke klona/full and klona/json subpath imports. The klona package maps all subpath exports to the same root ./index.d.ts types file — TypeScript in bundler mode rejects that pattern for subpath imports (TS7016).

Fix applied:

  1. Reverted tsconfig.json: moduleResolution back to "node" (was incorrectly changed to "bundler")
  2. Added tsconfig.path.json paths entry: maps @opentelemetry/semantic-conventions/incubating directly to the physical declaration file at node_modules/@opentelemetry/semantic-conventions/build/src/index-incubating

This is the correct approach — TypeScript node resolution cannot use package.json exports field for subpath imports, so the paths override bypasses it entirely and points TypeScript straight to the physical .d.ts. Compatible with all existing imports (klona, etc.) unchanged.

- Replace  with  (Resource is now type-only in v2)
- Replace  with constructor-level spanProcessors[] (addSpanProcessor removed in v2)
- Type-only import for Resource since verbatimModuleSyntax is enabled
- incubating subpath import unchanged (tsconfig moduleResolution fix applied separately)
…orts

Switching from moduleResolution:"node" to "bundler" allows TypeScript to
resolve subpath exports like @opentelemetry/semantic-conventions/incubating,
which uses the package exports field not visible under the legacy node resolver.
…ion:node

The @opentelemetry/semantic-conventions/incubating subpath export requires
moduleResolution:"bundler" which breaks dozens of other packages (astring,
klona, react-toastify, @floating-ui). Instead, inline the two string constants
(deployment.name, service.instance.id) directly — these are stable OTel spec
values that are safe to inline.
@subrata71 subrata71 self-assigned this Jul 16, 2026
@subrata71 subrata71 added the ok-to-test Required label for CI label Jul 16, 2026
@wyattwalter

Copy link
Copy Markdown
Contributor

Superceded by #42009

@wyattwalter
wyattwalter deleted the fix/opentelemetry-ecosystem-v2-upgrade branch July 17, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Required label for CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants