fix(deps): override morgan to 1.11.0 to resolve GHSA-4vj7-5mj6-jm8m#438
Open
tkislan wants to merge 1 commit into
Open
fix(deps): override morgan to 1.11.0 to resolve GHSA-4vj7-5mj6-jm8m#438tkislan wants to merge 1 commit into
tkislan wants to merge 1 commit into
Conversation
The `audit-all` CI job (better-npm-audit) was failing on morgan@1.10.1, which is vulnerable to log forging via unneutralized control characters in the :remote-user token (GHSA-4vj7-5mj6-jm8m / CVE-2026-5078, moderate, CVSS 5.3). morgan is a dev/test-only transitive dependency, never shipped in the extension bundle: @vscode/test-web@0.0.71 -> koa-morgan@1.0.1 -> morgan Resolved by adding a targeted npm override to 1.11.0 (the patched release, which is also the latest), consistent with the repo's existing override convention for transitive security fixes. 1.11.0 satisfies koa-morgan's `^1.6.1` range, so it is a semver-compatible minor bump and no `.nsprc` exception is warranted. The 1.10.1 -> 1.11.0 diff is tiny and additive (escapes control chars in the :remote-user token, plus a new :pid token); all predefined formats are unchanged, and @vscode/test-web uses the `dev` format, which does not reference :remote-user. The only other lockfile change is a dev-only nested on-finished dedupe (2.3.0 -> 2.4.1). Verified locally: `npx better-npm-audit audit` now exits 0 (was 1), `--production` still passes, prettier is clean, and the lockfile is drift-free (idempotent under `npm install`). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CPTs6CHNncauUuTGkwpNtH
Contributor
📝 WalkthroughWalkthroughThe Estimated code review effort: 1 (Trivial) | ~2 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #438 +/- ##
===========================
===========================
🚀 New features to boost your workflow:
|
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
audit-allCI job (npx better-npm-audit audit) is failing on a single non-excepted advisory:morgan@1.10.1— GHSA-4vj7-5mj6-jm8m / CVE-2026-5078 (moderate, CVSS 5.3): log forging via unneutralized control characters in the:remote-usertoken.This PR resolves it by pinning
morganto the patched 1.11.0 via a targeted npmoverride, matching the repo's established convention for transitive security fixes.Root cause
morganis a dev/test-only transitive dependency — never part of the shipped extension bundle (which is whyaudit-prodwas green whileaudit-allwas red):Fix
"overrides": { ... "form-data@>=4.0.0 <4.0.6": "4.0.6", + "morgan@<1.11.0": "1.11.0" }Why an override rather than an
.nsprcexception — consistent with how this repo distinguishes the two:1.11.0is the patched release (OSV:introduced 1.2.0,fixed 1.11.0) and the latest published version.koa-morgan's own declared range (morgan: ^1.6.1), so it resolves cleanly with no forced major..nsprcexceptions in this repo are reserved for breaking-major / no-fix-available cases — which does not apply here.Behavioral safety (per online research + tarball diff of 1.10.1 vs 1.11.0):
escapeLogField()helper applied to the:remote-usertoken, plus a new additive:pidtoken. All predefined formats (combined,common,dev,short,tiny) are textually unchanged.@vscode/test-webinvokes morgan with thedevformat, which never references:remote-user— so this repo's test-server log output is byte-for-byte identical after the bump. The new escaping only alters output when a Basic-auth username contains control characters (exactly the vulnerability being fixed).on-finisheddedupe (2.3.0 → 2.4.1).morgan@1.11.0is clean of any other known advisory (OSV + Snyk).Verification
npx better-npm-audit audit(audit-all)🤝 All good!)npx better-npm-audit audit --production(audit-prod)npx prettier --check package.jsonnpm installidempotent)Scope
Only
package.json(one-line override) andpackage-lock.json(morgan1.10.1 → 1.11.0+ nestedon-finisheddedupe) are touched. No source changes.🤖 Generated with Claude Code
https://claude.ai/code/session_01CPTs6CHNncauUuTGkwpNtH
Summary by CodeRabbit