fix(deps): force deepmerge-ts to 8.x to patch CVE-2026-40345 - #602
Merged
Conversation
@prisma/config pins deepmerge-ts at exactly 7.1.5, which is vulnerable to GHSA-ggr8-5vv4-36mx (stack exhaustion when merging recursive object graphs). It reaches the production tree through @prisma/client's optional dependency on the prisma CLI, so both supply-chain gates fail on every PR: `pnpm audit --prod` (1 high) and the Trivy scan of the api image (1 HIGH, fix available). Dependabot cannot resolve it -- it reports `security_update_not_possible` because the exact pin caps the resolvable version at 7.1.5 -- and no published @prisma/config carries the bump yet, so a workspace override is the only path. The upstream fix is still open: prisma/orm#30054 The override is unscoped rather than parent-scoped, per the primary rule in pnpm-workspace.yaml: @prisma/config is the only consumer in the tree, and an unscoped override already breaks the exact pin.
17 tasks
nivek0o0
previously approved these changes
Aug 19, 2026
The override comment only pointed at the community PR. Add the upstream issue that tracks the bump (prisma/orm#30052) so the reason the override exists is readable from the issue alone, without inferring it from a PR diff.
nivek0o0
approved these changes
Aug 20, 2026
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.
Why
AuditandTrivy Image Scan (api)are failing on every PR againstmain. Both report the same advisory — this is one problem, not two.GHSA-ggr8-5vv4-36mx / CVE-2026-40345 —
deepmerge-tsstack exhaustion when merging recursive object graphs. Vulnerable<8.0.0; the tree had7.1.5.It is a production-tree dependency through
@prisma/client's optional dependency on theprismaCLI:Audit—pnpm audit --prod --audit-level moderate→ 1 high.Trivy Image Scan (api)—Total: 1 (HIGH: 1, CRITICAL: 0), fix available. The web image is clean.This is unrelated to any feature branch;
mainis affected too. Its last green Trivy run was 2026-08-17 12:44, and the advisory landed at 14:08 the same day.Why an override
Dependabot already tried and gave up with
security_update_not_possible/latest-resolvable-version: 7.1.5:@prisma/config@7.9.1pinsdeepmerge-tsat exactly7.1.5(no range), andprisma@latestis 7.9.1.No published
@prisma/configcarries the bump — not7.9.1, not the newest prerelease7.10.0-dev.58(published 2026-08-17, i.e. after deepmerge-ts 8.0.0 shipped on 2026-08-16). Upstream knows and has not moved: the tracking issue is open, unlabelled and with no maintainer reply (prisma/orm#30052), and the only fix for it is an open, community-authored PR againstv7with no maintainer review (prisma/orm#30054).Prisma 8 drops
@prisma/configentirely (prisma@8.0.0-rc.6depends on@prisma/cli-engine+@prisma/orm-toolchaininstead), so this resolves itself on that major — but that is an RC and not an option now.So a workspace override is the only path, which is what
pnpm-workspace.yamlalready documents for exactly this case.What changed
pnpm-workspace.yaml— one entry inoverrides, plus the lockfile re-resolution.Unscoped rather than
@prisma/config>deepmerge-ts, per the primary rule in that file ("declare the override on the vulnerable package itself"):@prisma/configis the only consumer in the lockfile, and an unscoped override already breaks the exact pin — verified, not assumed. The comment carries both upstream links so the override can be dropped once a published@prisma/configships deepmerge-ts >= 8.Major-bump safety
deepmerge-ts8 is a major, so this was checked rather than trusted:@prisma/configuses exactly one thing from it —const { deepmerge } = await import("deepmerge-ts"), passed as c12'smerger.deepmergeis unchanged in v8.mergeRecords→mergeRecordsFast).@prisma/configships prebuilt JS and its.d.tsnever referencesdeepmerge-ts, so none of that surfaces.minimumReleaseAge: 1440is satisfied — 8.0.1 was published 2026-08-16.Verification
deepmerge-ts@8.0.1pnpm audit --prod --audit-level moderateNo known vulnerabilities foundprisma validateprisma.config.ts, schema validprisma generatepnpm format/pnpm lint/pnpm type-checkThe two
prismainvocations are the point of the functional check: they exercise the@prisma/config→deepmergecode path on the new major.Trivy was not re-run locally (it needs a full image build), but its single finding named this exact package and version, so it clears with the lockfile. CI on this PR is the real confirmation.