fix(deps): overrides로 prisma 간접 의존성 3건 high 권고 해소 - #101
Merged
Conversation
deepmerge-ts / mysql2 / nanoid가 @prisma/config, prisma 밑에서 exact 버전으로 고정돼 있어 dependabot version/security update로는 못 올라간다 — prisma 자체 최신 릴리스(7.10.0)도 여전히 취약 버전을 정확히 고정한다. deepmerge-ts <8.0.0 GHSA-ggr8-5vv4-36mx 스택 소진(재귀 객체 그래프 병합) mysql2 <=3.23.0 평문 자격증명 유출 / 압축 프로토콜 압축폭탄 DoS nanoid <3.3.18 GHSA-2v37-7h3g-55p8 size 0일 때 커스텀 생성기 무한루프 stash가 같은 상황을 overrides로 이미 해결해뒀다(nanoid ^3.3.18, deepmerge-ts ^8.0.1, mysql2 ^3.22.0) — 같은 prisma 7.10.0 계열이라 그대로 이식한다. package.json 수정 후 `npm install`만으로는 기존 락파일이 갱신되지 않아 `npm update nanoid mysql2 deepmerge-ts`로 명시적으로 재해석시켰다 — 그 결과 세 패키지와 mysql2 내부 하위 의존성(denque, seq-queue, sql-escaper, sqlstring)만 바뀌고 나머지 트리는 그대로다. 이로써 garage의 프로덕션·전체 트리 모두 0 vulnerabilities가 된다. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
garage에 남아 있던 마지막 취약점들이다. 이 PR 이후 프로덕션·전체 트리 모두 0 vulnerabilities가 된다.
문제
Dependabot alert 2건이 열려 있었고, 실제로는 dev 트리에 1건이 더 있었다 — GitHub alert 스캔이
deepmerge-ts를 못 잡은 것으로 보인다.deepmerge-tsmysql2nanoid셋 다
prisma/@prisma/config밑에서 exact 버전으로 고정돼 있다 (mysql2: "3.15.3"처럼 캐럿도 없다).npm audit fix를 쓰면 이렇게 나온다.prisma 자체 최신 릴리스(7.10.0, 이 저장소가 이미 쓰는 버전)도 여전히 같은 취약 버전을 정확히 고정하고 있어서, prisma를 올려도 해결되지 않는다. Dependabot의 version/security update는 이런 간접 의존성의 exact pin을 건드리지 못한다.
해결
stash가 같은 상황을
npm overrides로 이미 해결해뒀다 — 같은@prisma/client ^7.10.0계열이라 그대로 이식한다."overrides": { "postcss": "^8.5.23", "sharp": "^0.35.3", "find-my-way": "^9.7.0", - "valibot": "^1.4.2" + "valibot": "^1.4.2", + "nanoid": "^3.3.18", + "deepmerge-ts": "^8.0.1", + "mysql2": "^3.22.0" },왜 diff가 이렇게 좁은가
package.json을 고친 뒤npm install만으로는 기존 락파일이 갱신되지 않았다(재현 확인함). 전체 재설치(rm -rf node_modules && npm install)를 시도했더니 override 3건은 잘 반영됐지만 next·esbuild 등 무관한 패키지 수십 개까지 최신으로 끌려와 diff가 707줄이 됐다 — 보안 수정 PR에 섞기엔 범위가 너무 넓어서 되돌렸다.대신
npm update nanoid mysql2 deepmerge-ts로 세 패키지만 명시적으로 재해석시켰다. 결과적으로 그 셋과mysql2의 직속 하위 의존성(denque,seq-queue,sql-escaper,sqlstring)만 바뀐다 — 79줄.검증
npm audit(dev 포함) /npm audit --omit=dev모두 0 vulnerabilitiesnpm run build/npm run test통과 — api 20 files 137 tests, web 7 files 29 tests🤖 Generated with Claude Code