deps: resolve 123 Dependabot security alerts (safe, non-breaking)#136
Conversation
Apply safe, in-major security fixes across all three lockfiles via npm overrides pinned to GHSA-patched versions plus range-respecting updates (no major-version bumps). Resolves 125 of 160 open Dependabot alerts. Root package.json overrides: @xmldom/xmldom, cipher-base, fast-uri, flatted, follow-redirects, form-data, koa, launch-editor, lodash, morgan, node-forge, on-headers, pbkdf2, postcss, protobufjs, qs, serialize-javascript, sha.js, shell-quote, tmp, undici, ws. Also bump webpack devDependency to ^5.104.1 and range-update ajv, bn.js, glob, tar-fs, picomatch, minimatch, brace-expansion, nanoid, playwright. src.gen streaming clients: npm audit fix (lodash, minimatch, @smithy/config-resolver) and override fast-xml-parser to 4.5.7. Remaining alerts require major-version bumps or coordinated @aws-sdk upgrades and are handled separately.
Problem: The webpack ^5.95.0 -> ^5.104.1 bump (added to fix SSRF alerts aws#68/aws#69) pulls webpack 5.108.4 and enhanced-resolve 5.24.2. The newer resolver applies stricter exports-field resolution and can no longer resolve the aws-core-vscode/shared subpath from compiled packages/core/dist in the web bundle, breaking the webBase build. Only the web jobs (package VSIX, test Web) fail; all Node-based jobs pass. Solution: Revert webpack to ^5.95.0, restoring enhanced-resolve 5.17.1 to match main. Dependabot aws#68/aws#69 are build-time SSRF in webpack's HttpUriPlugin/buildHttp experimental feature, which this repo does not use, so real-world risk is negligible. They are intentionally left open and will be fixed thoroughly in a follow-up PR together with the core exports / webpack resolve compatibility work.
CI fix: reverted the
|
Resolve the security alerts that require major-version bumps or coordinated transitive upgrades, on top of the safe (category 1) fixes. Brings total resolved to 152 of 160 open Dependabot alerts. Direct bumps: - markdown-it 13 -> ^14.2.0 (+ @types/markdown-it ^14.1.2) [core] - esbuild-loader 2.20.0 -> 4.5.0 [core] (ESBuildMinifyPlugin -> EsbuildPlugin in webpack.base.config.js; pulls esbuild 0.25+) - webpack-dev-server ^4.15.2 -> ^5.2.5 (devServer config uses only options still valid in v5) Overrides / range updates (root): - fast-xml-parser -> 5.7.0 (GHSA-gh4j has no 4.x backport; forces the AWS SDK's XML parser to 5.x - see risk note) - markdown-it 14.2.0, linkify-it 5.0.1, jsonata 2.2.1 - js-yaml@4 -> 4.2.0 (scoped so js-yaml 3.x consumers are untouched) - @smithy/config-resolver, @opentelemetry/core updated to patched lines src.gen streaming clients: - fast-xml-parser override 4.5.7 -> 5.7.0 Note: keeps webpack at ^5.95.0 (see PR aws#136) so the web build stays green; webpack aws#68/aws#69 remain deferred and are addressed separately in this PR. Risk to validate in CI: forcing fast-xml-parser 5.x onto the AWS SDK may affect XML-based SDK responses (S3/EC2/CloudFormation).
Resolve the security alerts that require major-version bumps or coordinated transitive upgrades, on top of the safe (category 1) fixes. Brings total resolved to 152 of 160 open Dependabot alerts. Direct bumps: - markdown-it 13 -> ^14.2.0 (+ @types/markdown-it ^14.1.2) [core] - esbuild-loader 2.20.0 -> 4.5.0 [core] (ESBuildMinifyPlugin -> EsbuildPlugin in webpack.base.config.js; pulls esbuild 0.25+) - webpack-dev-server ^4.15.2 -> ^5.2.5 (devServer config uses only options still valid in v5) Overrides / range updates (root): - fast-xml-parser -> 5.7.0 (GHSA-gh4j has no 4.x backport; forces the AWS SDK's XML parser to 5.x - see risk note) - markdown-it 14.2.0, linkify-it 5.0.1, jsonata 2.2.1 - js-yaml@4 -> 4.2.0 (scoped so js-yaml 3.x consumers are untouched) - @smithy/config-resolver, @opentelemetry/core updated to patched lines src.gen streaming clients: - fast-xml-parser override 4.5.7 -> 5.7.0 Note: keeps webpack at ^5.95.0 (see PR #136) so the web build stays green; webpack #68/#69 remain deferred and are addressed separately in this PR. Risk to validate in CI: forcing fast-xml-parser 5.x onto the AWS SDK may affect XML-based SDK responses (S3/EC2/CloudFormation).
* fix: resolve CodeQL code-scanning security alerts
Problem:
17 open CodeQL code-scanning alerts across source, tests, dev scripts,
and a workflow (ReDoS, incomplete sanitization, shell-command injection
from environment, and a missing workflow permissions block).
Solution:
- ReDoS (js/polynomial-redos): rewrite vulnerable regexes as linear
equivalents - indent()/block-comment/base64url padding in
textUtilities.ts; use-strict/require detection in importAdderUtil.ts;
trailing '/' and '#' stripping in auth.ts and authUtil.ts (behavior
verified against existing unit tests).
- Shell injection (js/shell-command-injection-from-environment): replace
execSync(string) with execFileSync('git', [...args]) (no shell) in
scripts/createRelease.ts and scripts/newChange.ts.
- Incomplete sanitization (js/incomplete-sanitization): replace all
quotes, not just the first, in ssh.test.ts.
- URL substring checks (js/incomplete-url-substring-sanitization): use
assert.match instead of includes() on URLs in
referenceLogViewProvider.test.ts.
- Workflow permissions (actions/missing-workflow-permissions): add a
least-privilege top-level 'contents: read' to release.yml (the publish
job keeps its explicit 'contents: write').
- Certificate validation (js/disabling-certificate-validation): this is
an explicit user opt-in mirroring VS Code's 'http.proxyStrictSSL';
kept the behavior, upgraded the log to a warning, and documented it.
None of these overlap with the dependency PRs (#136-138).
* fix: match quoted use-strict directive after ReDoS hardening
The anchored /^\s*use\s+strict/ regex missed quoted directives like
'use strict'; (line starts with a quote), breaking
importAdderUtil 'first line after comments and use strict'. Allow an
optional leading quote: /^\s*['"]?use\s+strict/ (still anchored/linear).
* fix: strip all block comments in stripNewLinesAndComments
Add the global flag to the ReDoS-hardened block-comment regex so lines
with multiple block comments are fully stripped (and code between them is
preserved), matching the function's documented intent. Addresses review
feedback on #140; the g flag keeps the regex linear (no ReDoS).
Problem
The repository has 160 open Dependabot security alerts across four manifests
(root
package-lock.json,packages/core/package.json, and the twosrc.genstreaming-client lockfiles). Many are low-risk transitive dependencies that can
be patched without any breaking change.
Solution
Resolve the non-breaking (safe) subset first: security patches that stay
within the same major version, using npm
overridespinned to the exactGHSA-patched versions plus range-respecting
npm update(so lower major linesare never force-upgraded). No public API or major version of any direct
dependency changes in this PR.
This PR resolves 123 of 160 alerts. The remainder require major-version
bumps or coordinated
@aws-sdkupgrades and will follow as separate commits /a second PR (see Remaining work below).
Alerts resolved by manifest
package-lock.json(root)src.gen/@amzn/amazon-q-developer-streaming-client/package-lock.jsonsrc.gen/@amzn/codewhisperer-streaming/package-lock.jsonpackages/core/package.jsonKey fixes (root
package.jsonoverrides + updates)src.genstreaming clientsRemaining work (follow-up commits / second PR)
webpack(SSRF)enhanced-resolve5.24.x, which breaks the web build'sexportsresolution (see note below). Deferred to a follow-up PR that also fixes coreexports/ webresolve. Build-time SSRF in the unusedbuildHttpfeature — negligible real risk.fast-xml-parser<5.7.0(GHSA-gh4j)markdown-it+linkify-itwebpack-dev-serverjs-yaml4.1.0→4.2.0mochapins exactly4.1.0jsonata,aws-sdk,elliptic,esbuild,@smithy/config-resolver,@opentelemetry/coreaws-sdkv2,elliptic)@protobufjs/utf8protobufjs@7.6.3(stale alert)Verification
npm audit(lockfile-only) on all three lockfiles: root criticals reduced to0; both
src.genlockfiles report 0 critical / 0 high.npm install --package-lock-onlyproduces no further changes).webpack/enhanced-resolvepinned back tomain's versions (5.95.0 /5.17.1) to keep the web build green.
feature/xbranches will not be squash-merged at release time.