NONJAVACLI-4353: bump axios and pin transitive deps for CVE fixes#478
NONJAVACLI-4353: bump axios and pin transitive deps for CVE fixes#478Devarsh Patel (Devarsh010) wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Updates dependency versions to address CVEs flagged by Trivy / npm audit across the monorepo, primarily by bumping axios and adding root-level npm overrides, then regenerating the lockfile.
Changes:
- Bump
axiosto^1.15.0inschemaregistryandschemaregistry-examples. - Add a root
overridesblock to force patched transitive dependency versions. - Regenerate
package-lock.jsonto reflect the patched dependency tree.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
schemaregistry/package.json |
Bumps direct axios dependency to a patched release. |
schemaregistry-examples/package.json |
Bumps dev axios dependency to a patched release. |
package.json |
Adds root npm overrides to enforce patched transitive versions. |
package-lock.json |
Lockfile regeneration reflecting the new overrides and updated transitive graph. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "overrides": { | ||
| "axios": "^1.15.0", | ||
| "follow-redirects": ">=1.16.0", | ||
| "@tootallnate/once": ">=3.0.1", | ||
| "serialize-javascript": ">=7.0.5", |
There was a problem hiding this comment.
The new overrides are described as “pinning transitive deps”, but several entries use open-ended ranges (>=... / ^...). That can allow unexpected future major upgrades to enter the tree without a repo change, and reduces reproducibility. Consider switching these overrides to exact versions or upper-bounded ranges so they’re actually pinned to a reviewed set.
f423bec to
3e4c503
Compare
The CVE-fix lockfile regen picked up @types/node 20.19.41 (Uint8Array became generic) and ts-jest 29.4.10 (nodenext subpath resolution regression). Both surfaced pre-existing fragility unrelated to the CVE fixes. - aes_siv.ts: wrap miscreant's seal/open in new Uint8Array(...) to materialize Uint8Array<ArrayBuffer>; swap @ts-expect-error to @ts-ignore since raw tsc still can't resolve miscreant's types - pin ts-jest 29.4.9 in root + schemaregistry: 29.4.10 fails to resolve @criteria/json-schema/draft-{07,2020-12}
What
Patches CVEs flagged by Trivy and
npm auditagainstconfluent-kafka-javascriptv1.9.0. Primarilypackage.jsonoverrides + direct dep bumps. One small TS adjustment inaes_siv.tsand a devDep pin onts-jestare included as a separate commit to unblock CI from regressions surfaced by the lockfile regen (see Notes below).Direct dep bumps
schemaregistry/package.json—axios^1.13.5→^1.15.0schemaregistry-examples/package.json—axios^1.13.5→^1.15.0package.json(root) —ts-jest^29.2.5→29.4.9(exact pin)schemaregistry/package.json—ts-jest^29.2.4→29.4.9(exact pin)Root
overridesblock added to pin vulnerable transitive deps to patched versions. Overrides live only in the rootpackage.jsonbecause npm honorsoverridesonly at the top of the project — duplicating them in workspacepackage.jsonfiles would be silently ignored.^1.15.0>=1.16.0>=3.0.1@google-cloud/kms)>=7.0.5>=7.5.10>=1.13.8>=4.18.0^7.5.5google-gaxpeer dep)>=8.0.3Lockfile regenerated against
registry.npmjs.org.Notes on deliberate omissions
fast-xml-parser(vulnerable range5.0.0–5.3.7) is not pinned. The@aws-sdk/xml-builderpeer dep naturally resolves it to5.5.8, which is past the vulnerable range. Adding an override forced version conflicts with@aws-sdk's exact peer requirement during testing — minimum-necessary-intervention.mochais not downgraded.npm audit fix --forcewould have downgraded mocha to7.2.0(a breaking change) to escape vulnerableserialize-javascript@6.x. Ourserialize-javascriptoverride pins the transitive directly while leaving mocha at10.8.2.Notes on CI unblock (commit
ad7a514)The lockfile regen pulled in
@types/node20.19.41 (within^20.16.1) andts-jest29.4.10 (within^29.2.4) — both unrelated to the CVE work but they surfaced pre-existing fragility in the schemaregistry workspace:aes_siv.ts:@types/node20.19.41 madeUint8Arraygeneric (Uint8Array<ArrayBufferLike>), so miscreant'sseal/openreturn type no longer assigned to our declaredUint8Array<ArrayBuffer>. Fixed by wrapping the returns innew Uint8Array(...)to materialize a fresh ArrayBuffer-backed copy, and swapping@ts-expect-error→@ts-ignore(rawtscstill can't resolve miscreant's types because itsexportsmap omits the"types"condition).ts-jest29.4.10 has a nodenext subpath-resolution regression that breaks@criteria/json-schema/draft-{07,2020-12}imports. 29.4.9 is the latest known-good; pinned exactly until upstream ships a fix.Neither bug is caused by our CVE changes — they would have surfaced on the next Renovate-triggered lockfile bump regardless. No functional behavior change (the
new Uint8Array(...)wrap is byte-equivalent).Checklist
aes_siv.tschange preserves the existingUint8Array<ArrayBuffer>public signature and is byte-equivalent at runtime.References
JIRA:
https://confluentinc.atlassian.net/browse/NONJAVACLI-4353
https://confluentinc.atlassian.net/browse/NONJAVACLI-4328
Test & Review
All run locally on macOS arm64 against a clean
node_modulesand lockfile regenerated againstregistry.npmjs.org:npm audit --registry=https://registry.npmjs.org/make lint(cpplint + eslint)make test(root mocha unit)cd schemaregistry && make test(jest unit)cd schemaregistry && make integtest(real Kafka + Schema Registry via docker-compose)make promisified_test(Kafka client jest e2e against real broker)547 tests run, 542 passed, 5 expected skips, 0 unexpected failures.