Drop uuid and bump vulnerable transitives for @kurrent/kurrentdb-client#499
Drop uuid and bump vulnerable transitives for @kurrent/kurrentdb-client#499
uuid and bump vulnerable transitives for @kurrent/kurrentdb-client#499Conversation
The repo requires Node >=20, so the bundled crypto.randomUUID covers all uuid v4 generation. Drops the uuid dep entirely. - Swap v4() callsites in db-client and test to randomUUID - Replace uuid.stringify in grpcUUID with structuredUUIDToString, computing the canonical UUID string directly from the proto's msb/lsb int64 strings (mask handles two's-complement negatives, which the previous setBigUint64 path threw on) - Add grpcUUID.test.ts covering structuredUUIDToString and parseUUID - Remove uuid and @types/uuid from db-client and test packages
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.9 to 1.16.0. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](follow-redirects/follow-redirects@v1.15.9...v1.16.0) --- updated-dependencies: - dependency-name: follow-redirects dependency-version: 1.16.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [protocol-buffers-schema](https://github.com/mafintosh/protocol-buffers-schema) from 3.6.0 to 3.6.1. - [Commits](mafintosh/protocol-buffers-schema@v3.6.0...v3.6.1) --- updated-dependencies: - dependency-name: protocol-buffers-schema dependency-version: 3.6.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [protobufjs](https://github.com/protobufjs/protobuf.js) from 7.4.0 to 7.5.5. - [Release notes](https://github.com/protobufjs/protobuf.js/releases) - [Changelog](https://github.com/protobufjs/protobuf.js/blob/master/CHANGELOG.md) - [Commits](protobufjs/protobuf.js@protobufjs-v7.4.0...protobufjs-v7.5.5) --- updated-dependencies: - dependency-name: protobufjs dependency-version: 7.5.5 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [axios](https://github.com/axios/axios) from 1.7.9 to 1.15.1. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](axios/axios@v1.7.9...v1.15.1) --- updated-dependencies: - dependency-name: axios dependency-version: 1.15.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
Review Summary by QodoReplace uuid with crypto.randomUUID and bump vulnerable dependencies
WalkthroughsDescription• Replace uuid dependency with native crypto.randomUUID • Fix latent bug in UUID parsing with high bit set • Add comprehensive test coverage for UUID utilities • Bump vulnerable transitive dependencies to secure versions Diagramflowchart LR
A["uuid v11.0.3"] -->|"Replace with"| B["crypto.randomUUID"]
C["Old UUID parsing<br/>setBigUint64 throws"] -->|"Fix with"| D["structuredUUIDToString<br/>with bit masking"]
E["Vulnerable transitives<br/>protobufjs, axios, etc."] -->|"Bump to secure"| F["Updated versions<br/>in yarn.lock"]
B --> G["Reduced dependencies<br/>Node >=20 only"]
D --> H["New grpcUUID.test.ts<br/>test coverage"]
File Changes1. packages/db-client/src/Client/index.ts
|
Code Review by Qodo
1. Ambiguous crypto module import
|
Resolves the dependabot security alerts that affect the published library. Closes the open dependabot PRs (#487, #488, #489, #490, #491, #498) in one bundle so they land coherently and CI passes (the originals failed because dependabot's lockfile changes don't survive yarn 4 hardened-mode post-resolution validation).
Replace
uuidwithcrypto.randomUUIDcrypto.randomUUIDhas been available since Node14.17, the package requires Node >=20. This dropsuuidand@types/uuidfrom bothdb-clientandtest.uuid.stringifyingrpcUUID.tswith a newstructuredUUIDToStringhelper that computes the canonical UUID string directly from the proto's msb/lsb int64 strings. The mask& ((1n << 64n) - 1n)reinterprets two's-complement negatives as unsigned, which incidentally fixes a latent bug: the previoussetBigUint64path threwRangeErroron any UUID whose first or 9th byte was >= 0x80.packages/test/src/extra/grpcUUID.test.tscoveringstructuredUUIDToStringandparseUUID.Bump vulnerable transitives in yarn.lock
Cherry-picked from the open dependabot PRs, then
yarn installto reconcile the lockfile. Followed byyarn dedupefor additional cleanup.