fix(cli): clear the 5 npm audit advisories a fresh scaffold reports - #1419
Merged
Conversation
A freshly created app reported 5 high-severity advisories the moment scaffolding finished, all of them GHSA-jmr9-qjv8-65gv in extract-zip, reached through @web/test-runner's unconditional dependency on @web/test-runner-chrome and its puppeteer-core@24 chain. extract-zip has no patched version, so the floor has to sit at puppeteer-core: its 25 line moved to @puppeteer/browsers@3, which dropped extract-zip entirely. The scaffold launches browsers through Playwright, so none of that puppeteer code was ever executed by a generated app in the first place.
vivek7405
marked this pull request as ready for review
August 15, 2026 07:42
vivek7405
added a commit
that referenced
this pull request
Aug 15, 2026
Ships the scaffold audit fix from #1419, so that `npm create webjs` stops emitting apps that report 5 high-severity advisories on their first install. The fix only reaches users through a published `@webjsdev/cli`, since `create-webjs` resolves it from the registry. The changelog is hand-written rather than generated. The generator matches conventional subjects in the package tree, and the unreleased log for `@webjsdev/cli` also carries the `feat:` subject from #1414, whose work was fully reverted by #1417. That revert landed with a `revert:` prefix the generator does not match, so an auto-generated entry would have advertised a feature that is not in the code.
vivek7405
added a commit
that referenced
this pull request
Aug 15, 2026
Ships the scaffold audit fix from #1419, so that `npm create webjs` stops emitting apps that report 5 high-severity advisories on their first install. The fix only reaches users through a published `@webjsdev/cli`, since `create-webjs` resolves it from the registry. The changelog is hand-written rather than generated. The generator matches conventional subjects in the package tree, and the unreleased log for `@webjsdev/cli` also carries the `feat:` subject from #1414, whose work was fully reverted by #1417. That revert landed with a `revert:` prefix the generator does not match, so an auto-generated entry would have advertised a feature that is not in the code.
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.
Closes #1418
Summary
A freshly created app reported 5 high-severity npm audit advisories the moment
webjs createfinished installing, which is the first thing anyone sees after scaffolding. All 5 are one advisory (GHSA-jmr9-qjv8-65gv, an unvalidated symlink path traversal inextract-zip) reached through one chain, and the generatedpackage.jsonnow pins apuppeteer-corefloor that clears it.What was actually wrong
Two things kept this from being a real exposure, and both are worth stating because they are why the fix is a one-line floor rather than a dependency swap. It is a devDependency, never reachable from an app's runtime. And a scaffolded app does not execute that code at all:
templates/web-test-runner.config.jslaunches browsers throughplaywrightLauncher({ product: 'chromium' }), so the puppeteer chrome launcher is dead weight that@web/test-runnerpulls in unconditionally through its own hard dependency on@web/test-runner-chrome. There is no supported way to install the runner without it, so the choice was between overriding the transitive version and living with the advisory.Why the floor sits at puppeteer-core
extract-ziphas no patched version. The advisory covers*, and2.0.1is the newest release, so an override onextract-zipitself resolves nothing. One level up does:@puppeteer/browsers@3.xdroppedextract-zipentirely (it unpacks withmodern-tar), andpuppeteer-core@25.xdepends on that 3 line.puppeteer-core@24.43.1pins@puppeteer/browsersexactly, with no caret, so npm cannot dedupe its way out and an explicitoverridesentry is the only lever. It is a caret rather than an exact pin because this is a security floor and a generated app should pick up later 25.x patches, which is deliberately the opposite of thedrizzle-ormreasoning a few lines above it, where the exact pin exists because the scaffold source is written against one rc API.Rejected: bumping @web/test-runner to ^1.0.0
This is what
npm audit fix --forceproposes, and it does not fix the advisory.@web/test-runner@1.0.0depends on@web/test-runner-chrome@^1.0.0, which still declares"puppeteer-core": "^24.0.0", so the same vulnerable chain resolves. Taking a breaking major that leaves the audit red is strictly worse than the override, so the v1 line stays out of this PR.Verification
Generated an app from this branch's
scaffoldAppand installed it for real:npm auditreportsfound 0 vulnerabilities, down from5 high severity vulnerabilitiesonmain.npm ls extract-zipin that app now returns an empty tree, so the package is not installed at all rather than installed at a tolerated version.npm testin a scaffolded app passes, 8 tests across the server and browser layers, 0 failed, with browser tests launching Chromium through Playwright exactly as before. This is the half that matters for the override, since it forces a version outside@web/test-runner-chrome's declared^24.0.0range.Test plan
test/scaffolds/scaffold-integration.test.jsasserts the override is emitted, for the full-stack and api templates alike, since the manifest is shared and a laterisApibranch could silently drop it from onepackages/cli/lib/create.jsto its parent state reds that test withfull-stack overrides puppeteer-core past the @puppeteer/browsers@2 line, and restoring it greens againtest/scaffolds/scaffold-integration.test.jssuite, 13 passed, 0 failedSurfaces
test/scaffolds/scaffold-integration.test.js. Browser, e2e, and Bun layers are N/A because this changes one key in the manifest the scaffold writes and touches no runtime code, no served bytes, and nothing runtime-sensitive.packages/core,packages/server, the dist build, or the importmap changed.examples/blogandwebsitedo not read the scaffold manifest.