Skip to content

Block preview/dev/alpha drift of @azure/monitor-opentelemetry-exporter#1504

Merged
JacksonWeber merged 1 commit into
microsoft:mainfrom
JacksonWeber:jacksonweber/pin-azure-monitor-prereleases
Jun 15, 2026
Merged

Block preview/dev/alpha drift of @azure/monitor-opentelemetry-exporter#1504
JacksonWeber merged 1 commit into
microsoft:mainfrom
JacksonWeber:jacksonweber/pin-azure-monitor-prereleases

Conversation

@JacksonWeber

Copy link
Copy Markdown
Contributor

Summary

The ^1.0.0-beta.41 caret range on @azure/monitor-opentelemetry-exporter is permissive enough under semver that npm install (without a lockfile) can resolve it to @azure/monitor-opentelemetry-exporter@1.0.0-preview.6 — the prerelease identifier preview sorts higher than beta lexicographically, so semver.maxSatisfying picks it as the "best" match.

1.0.0-preview.6 (published October 2020) still exists on npm and reintroduces:

Today we are protected only because @azure/monitor-opentelemetry@1.18.0 happens to pin the exporter to an exact version transitively, but that protection is fragile and would not hold for a lockfile-less consumer install.

Fix

Replace the caret with an explicit two-clause range:

- "@azure/monitor-opentelemetry-exporter": "^1.0.0-beta.41",
+ "@azure/monitor-opentelemetry-exporter": ">=1.0.0-beta.41 <1.0.0-c || ^1.0.0",

The range:

  • allows the current 1.0.0-beta.41 and all future 1.0.0-beta.* (the b in beta is alphabetically less than c); and
  • allows future stable 1.x.x releases via the || ^1.0.0 clause; but
  • rejects 1.0.0-preview.*, 1.0.0-dev.*, and 1.0.0-alpha.* because their prerelease identifiers sort >= c.

Behavior matrix

Version Matches? Notes
1.0.0-beta.41 (current) resolves identically to today
1.0.0-beta.42+ future betas
1.0.0-preview.* blocked (was the resolution bug)
1.0.0-dev.* blocked
1.0.0-alpha.* blocked
1.0.0 stable, 1.x.x via `
2.x.x matches existing ^ semantics

Verified against the live npm registry version list with semver.satisfies / semver.maxSatisfying.

Verification

  • package-lock.json resolved version unchanged: 1.0.0-beta.41.
  • Runtime tree contains 0 occurrences of json-bigint, gcp-metadata, @opentelemetry/tracing, or @azure/core-http.
  • npm install + tsc clean.
  • npm run test:unit: 247 passing, 0 failing.

Fixes #1502.
Fixes #1501.

…xporter

The `^1.0.0-beta.41` caret range previously specified for
`@azure/monitor-opentelemetry-exporter` is permissive enough under semver
that `npm install` (with no lockfile) can resolve it to
`@azure/monitor-opentelemetry-exporter@1.0.0-preview.6` -- the prerelease
identifier `preview` sorts higher than `beta` lexicographically, so
`maxSatisfying` picks it as the "best" match.

`1.0.0-preview.6` (published October 2020) still exists on npm and pulls
in the deprecated `@azure/core-http@1.2.6` -> `uuid@^8.3.0` chain, plus
the legacy `@opentelemetry/tracing@0.10.2` -> `@opentelemetry/resources@0.10.2`
-> `gcp-metadata@3.5.0` -> `json-bigint@0.3.1` chain. These transitives
re-introduce CVE-2020-8237 (json-bigint) and the GHSA-w5hq-g745-h8pq
uuid advisory that have been the subject of recent issue reports
(microsoft#1501, microsoft#1502). Today we are protected only because
`@azure/monitor-opentelemetry@1.18.0` happens to pin the exporter to an
exact version transitively, but that is fragile and would not hold for a
lockfile-less consumer install.

Replace the caret with an explicit two-clause range that:

  - allows the current `1.0.0-beta.41` and any future `1.0.0-beta.*` (the
    `b` in `beta` is alphabetically less than `c`); and
  - allows future stable `1.x.x` releases via the `|| ^1.0.0` clause; but
  - rejects `1.0.0-preview.*`, `1.0.0-dev.*`, and `1.0.0-alpha.*` because
    their prerelease identifiers sort >= `c`.

The resolved version in `package-lock.json` is unchanged
(`1.0.0-beta.41`), so the runtime tree is identical. All 247 unit tests
pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI 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.

Pull request overview

This PR tightens the version range for @azure/monitor-opentelemetry-exporter to prevent unintended resolution to older preview/dev/alpha prereleases (notably 1.0.0-preview.6) during lockfile-less installs, avoiding reintroduction of known vulnerable dependency chains.

Changes:

  • Replaces the permissive ^1.0.0-beta.41 dependency range with an explicit range that permits beta.* (from beta.41 onward) and stable 1.x.x, while blocking preview/dev/alpha.
  • Updates package-lock.json to reflect the new dependency spec (while keeping the resolved exporter version at 1.0.0-beta.41).

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
package.json Narrows the dependency range to prevent prerelease drift to insecure historical versions while still allowing stable 1.x.
package-lock.json Aligns the lockfile’s recorded dependency spec with package.json and retains resolution to 1.0.0-beta.41.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JacksonWeber JacksonWeber merged commit 9907aae into microsoft:main Jun 15, 2026
13 checks passed
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.

CVE-2020-8237 @azure/functions-old referring to deprecated version of uuid causing CG alerts

3 participants