Skip to content

fix(v10/bundler-plugins): Stamp debug IDs onto emitted source maps with disable-upload - #23619

Draft
msonnb wants to merge 1 commit into
v10from
ms/bundler-plugins-stamp-debug-ids-on-disable-upload
Draft

fix(v10/bundler-plugins): Stamp debug IDs onto emitted source maps with disable-upload#23619
msonnb wants to merge 1 commit into
v10from
ms/bundler-plugins-stamp-debug-ids-on-disable-upload

Conversation

@msonnb

@msonnb msonnb commented Aug 26, 2026

Copy link
Copy Markdown
Member

Note: intentionally against v10 for now. Will forward-port once #23398 lands and bug in cli v4 is fixed.

What

This fixes a bug where sourcemaps never got the debug ID injected when sourcemaps.disable was set to disable-upload. The emitted source maps now carry the bundle's debug ID whenever the upload is disabled.

Why

sourcemaps.disable: 'disable-upload' says that "the plugin will not upload sourcemaps to Sentry, but will inject debug IDs into the build artifacts. This is useful if you want to manually upload sourcemaps to Sentry at a later point in time." The debug ID only ever reached the bundle, the emitted .js.map never got one, so the manual upload the option exists for produced an artifact bundle where every entry had debugId: null and nothing symbolicates.

Debug ID stamping was part of the upload routine. prepareBundleForDebugIdUpload() writes both the //# debugId= comment and the map's debug_id into copies in a temp folder, uploades those, then deletes them. disable-upload gated out the entire upload() call, so it skipped the stamping along with the upload.

Fixes getsentry/sentry-javascript-bundler-plugins#949
Fixes getsentry/sentry-javascript-bundler-plugins#603

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.75 kB added added
@sentry/browser - with treeshaking flags 26.19 kB added added
@sentry/browser (incl. Tracing) 46.6 kB added added
@sentry/browser (incl. Tracing + Span Streaming) 48.39 kB added added
@sentry/browser (incl. Tracing, Profiling) 51.36 kB added added
@sentry/browser (incl. Tracing, Replay) 85.84 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.48 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 90.58 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 103.21 kB added added
@sentry/browser (incl. Feedback) 44.92 kB added added
@sentry/browser (incl. sendFeedback) 32.54 kB added added
@sentry/browser (incl. FeedbackAsync) 37.68 kB added added
@sentry/browser (incl. Metrics) 28.83 kB added added
@sentry/browser (incl. Logs) 29.06 kB added added
@sentry/browser (incl. Metrics & Logs) 29.75 kB added added
@sentry/react 29.56 kB added added
@sentry/react (incl. Tracing) 48.86 kB added added
@sentry/vue 33.18 kB added added
@sentry/vue (incl. Tracing) 48.57 kB added added
@sentry/svelte 27.77 kB added added
CDN Bundle 30.14 kB added added
CDN Bundle (incl. Tracing) 48.57 kB added added
CDN Bundle (incl. Logs, Metrics) 31.72 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) 49.87 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) 70.99 kB added added
CDN Bundle (incl. Tracing, Replay) 86.07 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87.37 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 91.87 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 93.14 kB added added
CDN Bundle - uncompressed 89.87 kB added added
CDN Bundle (incl. Tracing) - uncompressed 146.79 kB added added
CDN Bundle (incl. Logs, Metrics) - uncompressed 94.58 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 150.77 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 219.34 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 266.03 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 269.99 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.73 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 283.69 kB added added
@sentry/nextjs (client) 51.41 kB added added
@sentry/sveltekit (client) 47.02 kB added added
@sentry/core/server 80.5 kB added added
@sentry/core/browser 66.72 kB added added
@sentry/node-core 63.27 kB added added
@sentry/node 125.76 kB added added
@sentry/node (incl. diagnostics channel injection) 151.18 kB added added
@sentry/node/import (ESM hook with diagnostics-channel injection) 70.03 kB added added
@sentry/node/light 51.43 kB added added
@sentry/node - without tracing 74.95 kB added added
@sentry/aws-serverless 84.22 kB added added
@sentry/cloudflare (withSentry) - minified 202.05 kB added added
@sentry/cloudflare (withSentry) 496.75 kB added added

@msonnb

msonnb commented Aug 26, 2026

Copy link
Copy Markdown
Member Author

bugbot run


logger.info(
'Stamped debug IDs onto the emitted source maps. Upload them with `sentry-cli sourcemaps upload --debug-id-reference` to symbolicate stack traces.',
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Success logged when nothing stamped

Low Severity

After the worker pool finishes, the info log always claims debug IDs were stamped, even when every per-file stamp no-ops (missing debug ID marker, missing map, read/write failures). Those failures only emit debug/error logs, so the success message can mask a completely ineffective run.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit abddaf3. Configure here.

@msonnb
msonnb force-pushed the ms/bundler-plugins-stamp-debug-ids-on-disable-upload branch from abddaf3 to f844728 Compare August 26, 2026 12:13
@msonnb
msonnb changed the base branch from develop to v10 August 26, 2026 12:15
@msonnb msonnb changed the title fix(bundler-plugins): Stamp debug IDs onto emitted source maps with disable-upload fix(v10/bundler-plugins): Stamp debug IDs onto emitted source maps with disable-upload Aug 26, 2026
…disable-upload`

`sourcemaps.disable: 'disable-upload'` is documented for manually uploading
source maps at a later point in time, but the debug ID only ended up in the
bundle, never in the emitted source map - stamping happens on temporary copies
inside the upload routine that the flag switches off. A later
`sentry-cli sourcemaps upload` therefore produced an artifact bundle where every
entry has `debugId: null` and nothing symbolicates.

The emitted source maps now get the bundle's debug ID written into them when the
upload is disabled. Bundles stay byte-identical so hashes computed during the
build (e.g. for subresource integrity) remain valid.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@semgrep-code-getsentry

Copy link
Copy Markdown

Semgrep found 1 ssc-90df8fd1-2d4f-4e7b-a8aa-dfa15f51f5bf finding:

Risk: Affected versions of esbuild are vulnerable to Origin Validation Error. esbuild's development server responds to every request, including Server-Sent Events connections, with Access-Control-Allow-Origin: *. Any website a developer visits can therefore make cross-origin requests to the local dev server and read the responses, leaking bundled source code, source maps, and served file paths. Starting the dev server via serve() reaches the vulnerable code path.

Manual Review Advice: A vulnerability from this advisory is reachable if you run esbuild with the --serve flag to start the development server

Fix: Upgrade this library to at least version 0.25.0 at sentry-javascript/yarn.lock:14987.

Reference(s): GHSA-67mh-4wv8-2f99

Semgrep found 2 ssc-8ec0dd3e-cfd5-4a9b-9479-f5400432931f findings:

Risk: Affected versions of sharp are vulnerable to Dependency on Vulnerable Third-Party Component. sharp bundles a vulnerable version of the native libvips library, inheriting four memory-safety flaws: an integer overflow leading to a heap-based buffer overflow in the VIPS loader (vipsload, CVE-2026-33327), an integer overflow in the GIF loader (gifload, CVE-2026-33328) causing a denial of service on 32-bit hosts only, a heap-based buffer overflow in the TIFF loader (tiffload, CVE-2026-35591) when handling JPEG or JPEG2000-encoded tiles, and an out-of-bounds read in the EXIF directory decoder (CVE-2026-35590). An attacker who can supply a crafted image can crash the process or corrupt heap memory. Because sharp selects the libvips loader by sniffing the input bytes, no call site can be shown to be safe, and the EXIF flaw is reachable from the JPEG, TIFF, WebP, PNG and HEIF loaders as well. Upgrade to sharp 0.35.0 or later, which bundles libvips 8.18.3. Blocking the affected loaders with sharp.block({ operation: ["VipsForeignLoadNsgif", "VipsForeignLoadTiff", "VipsForeignLoadVips"] }) is only a partial stopgap and does not mitigate the EXIF out-of-bounds read (CVE-2026-35590), for which no workaround exists.

Fix: Upgrade this library to at least version 0.35.0 at sentry-javascript/yarn.lock:24908.

Reference(s): GHSA-f88m-g3jw-g9cj

Semgrep found 1 ssc-c8b7a1f2-4d36-4f0a-9e2b-1a5c8d7e6f30 finding:

Risk: Affected versions of vite and vite-plus are vulnerable to Exposure of Sensitive Information to an Unauthorized Actor / Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'). Vite's server.fs.deny blocklist—which protects sensitive files such as .env and certificate files from being served—can be bypassed on Windows using alternate path representations (NTFS Alternate Data Stream syntax like /.env::$DATA?raw, or 8.3 short filenames), allowing an attacker to read otherwise-denied files when the dev server is exposed to the network.

Manual Review Advice: A vulnerability from this advisory is reachable if you expose the Vite dev server or vite-plus to the network by configuring a non-loopback address using the --host CLI flag on Windows

Fix: Upgrade this library to at least version 6.4.3 at sentry-javascript/yarn.lock:27415.

Reference(s): GHSA-fx2h-pf6j-xcff, CVE-2026-53571

Semgrep found 1 ssc-17eda294-146f-4ed3-91f7-5ef1b349d687 finding:

Risk: Affected versions of @babel/traverse and babel-traverse are vulnerable to Incomplete List of Disallowed Inputs / Incorrect Comparison. Compiling untrusted code with Babel using plugins that invoke the internal path.evaluate() or path.evaluateTruthy() methods (for example @babel/plugin-transform-runtime, @babel/preset-env with useBuiltIns, or any polyfill‐provider plugin) allows a maliciously crafted AST to execute arbitrary code on the build machine during compilation.

Manual Review Advice: A vulnerability from this advisory is reachable if you use Babel to compile untrusted JavaScript

Fix: There are no safe versions of this library available for upgrade. Library included at sentry-javascript/yarn.lock:2594.

Reference(s): GHSA-67hx-6x53-jw92, CVE-2023-45133

@msonnb
msonnb force-pushed the ms/bundler-plugins-stamp-debug-ids-on-disable-upload branch from f844728 to 1486446 Compare August 26, 2026 12:26
@msonnb

msonnb commented Aug 26, 2026

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1486446. Configure here.

}

const stampedCount = results.filter(result => result === 'stamped' || result === 'alreadyStamped').length;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Repeated filters over stamp results

Low Severity

logStampingOutcome walks the same results array twice with separate .filter calls to count inline maps and stamped maps. The project review guidelines ask to avoid multiple loops over the same array and prefer a single classic for loop instead.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 1486446. Configure here.

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

Labels

None yet

Projects

None yet

1 participant