Block preview/dev/alpha drift of @azure/monitor-opentelemetry-exporter#1504
Merged
JacksonWeber merged 1 commit intoJun 15, 2026
Conversation
…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>
Contributor
There was a problem hiding this comment.
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.41dependency range with an explicit range that permitsbeta.*(frombeta.41onward) and stable1.x.x, while blockingpreview/dev/alpha. - Updates
package-lock.jsonto reflect the new dependency spec (while keeping the resolved exporter version at1.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.
rads-1996
approved these changes
Jun 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
^1.0.0-beta.41caret range on@azure/monitor-opentelemetry-exporteris permissive enough under semver thatnpm install(without a lockfile) can resolve it to@azure/monitor-opentelemetry-exporter@1.0.0-preview.6— the prerelease identifierpreviewsorts higher thanbetalexicographically, sosemver.maxSatisfyingpicks it as the "best" match.1.0.0-preview.6(published October 2020) still exists on npm and reintroduces:@azure/core-http@1.2.6→uuid@^8.3.0chain (GHSA-w5hq-g745-h8pq, reported in @azure/functions-old referring to deprecated version of uuid causing CG alerts #1501).@opentelemetry/tracing@0.10.2→@opentelemetry/resources@0.10.2→gcp-metadata@3.5.0→json-bigint@0.3.1chain (CVE-2020-8237, reported in CVE-2020-8237 #1502).Today we are protected only because
@azure/monitor-opentelemetry@1.18.0happens 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:
The range:
1.0.0-beta.41and all future1.0.0-beta.*(thebinbetais alphabetically less thanc); and1.x.xreleases via the|| ^1.0.0clause; but1.0.0-preview.*,1.0.0-dev.*, and1.0.0-alpha.*because their prerelease identifiers sort>= c.Behavior matrix
1.0.0-beta.41(current)1.0.0-beta.42+1.0.0-preview.*1.0.0-dev.*1.0.0-alpha.*1.0.0stable,1.x.x2.x.x^semanticsVerified against the live npm registry version list with
semver.satisfies/semver.maxSatisfying.Verification
package-lock.jsonresolved version unchanged:1.0.0-beta.41.json-bigint,gcp-metadata,@opentelemetry/tracing, or@azure/core-http.npm install+tscclean.npm run test:unit: 247 passing, 0 failing.Fixes #1502.
Fixes #1501.