Skip to content

chore(deps): 낡은 pnpm override 갱신해 high/critical 취약점 해소 - #121

Merged
CaesiumY merged 1 commit into
mainfrom
chore/audit-transitive-deps
Jul 28, 2026
Merged

CaesiumY merged 1 commit into
mainfrom
chore/audit-transitive-deps

Conversation

@CaesiumY

Copy link
Copy Markdown
Owner

문제

CI 머지 게이트 Code standards & build가 첫 단계인 pnpm audit --audit-level=high에서 15초 만에 실패해 모든 PR이 막혀 있었습니다. lint·format·build·E2E는 아예 실행되지 못하는 상태였습니다.

main 기준 pnpm audit → 24건 (low 2 / moderate 9 / high 12 / critical 1)

원인

신규 취약점 유입이 아니라, pnpm.overrides가 낡아서 취약 버전을 고정하고 있었습니다.

override 고정하던 값 필요
tar ^7.5.8 >=7.5.21
fast-uri ^3.1.2 >=3.1.4
astro>svgo 4.0.1 (캐럿 없음) >=4.0.2
@iconify/tools>svgo 3.3.3 (캐럿 없음) >=3.3.4

svgo 두 항목은 정확 고정이라 어떤 자동 업데이트로도 뚫을 수 없습니다. Dependabot이 tar(07-26 ×2)·js-yaml(07-27) 업데이트를 시도했다 모두 실패한 이유입니다.

변경

  • override 갱신: tar ^7.5.21 · fast-uri ^3.1.4 · astro>svgo 4.0.2 · @iconify/tools>svgo 3.3.4
  • override 신규: brace-expansion ^5.0.8 · js-yaml ^4.3.0 · postcss ^8.5.18 · sharp ^0.35.0
  • 직접 의존성: sharp ^0.34.5 → ^0.35.0

sharp는 직접 의존성만 올려서는 부족했습니다 — .>astro>sharp 경로로 astro가 자기 sharp를 따로 끌어와, override로 통일한 뒤에야 high가 0이 됐습니다.

범위를 좁힌 판단

게이트가 --audit-level=high이므로 high/critical만 대상으로 했습니다. astro(moderate/low)와 @astrojs/rss(moderate)는 게이트를 막지 않아 제외했고, 덕분에 astro ~6.4.7 → 7.1.0 메이저 업그레이드를 피했습니다.

결과

pnpm audit --audit-level=high   →  exit 0
24건 → 5건 (low 2 / moderate 3, high·critical 0)
패키지 before → after
tar 7.5.13 → 7.5.22
brace-expansion 5.0.5 → 5.0.8
js-yaml 4.1.1 → 4.3.0
postcss 8.5.10 / 8.5.15 → 8.5.24
svgo 3.3.3 / 4.0.1 → 3.3.4 / 4.0.2
fast-uri 3.1.2 → 3.1.4
sharp 0.34.5 → 0.35.3

로컬 검증

sharp 0.34 → 0.35는 Astro 이미지 파이프라인이 쓰는 패키지라 집중 확인했습니다.

  • pnpm audit --audit-level=high ✅ exit 0
  • pnpm build ✅ exit 0 · astro check 0 errors · WebP 200개 생성, srcset 반응형 정상
  • OG 이미지 36개 전부 유효한 1200×630 PNG (satori→sharp 경로 정상)
  • eslint (tracked 파일) ✅ · prettier --check ✅
  • playwright test ✅ 65 passed (CI와 동일하게 CI=true, 워커 1 + 재시도 2)
  • check-agent-docs-sync / check-claude-assets / check-post-classification ✅

후속

이 PR이 머지되면 #120(번역 발행)을 rebase해야 CI 검증을 받을 수 있습니다.

CI 머지 게이트(`pnpm audit --audit-level=high`)가 실패해 모든 PR이
막혀 있었습니다. 원인은 신규 취약점이 아니라 `pnpm.overrides`가
낡아서 취약 버전을 고정하고 있었던 것입니다. 특히 svgo 두 항목은
캐럿 없이 정확히 고정돼 있어 Dependabot 자동 업데이트가 반복 실패했습니다.

override 갱신:
- tar        ^7.5.8  -> ^7.5.21  (critical: node-tar DoS)
- fast-uri   ^3.1.2  -> ^3.1.4
- astro>svgo          4.0.1 -> 4.0.2
- @iconify/tools>svgo 3.3.3 -> 3.3.4

override 신규:
- brace-expansion ^5.0.8, js-yaml ^4.3.0, postcss ^8.5.18, sharp ^0.35.0

직접 의존성:
- sharp ^0.34.5 -> ^0.35.0 (astro가 끌어오는 전이 sharp도 override로 통일)

결과: high/critical 12건 -> 0건 (전체 24건 -> 5건, 남은 건 low/moderate).
moderate 이하인 astro/@astrojs/rss 메이저 업은 게이트 대상이 아니라 제외.

검증: audit(exit 0) · build(0 errors, WebP 200개, og.png 36개 유효) ·
eslint · prettier · E2E 65 passed
@claude

claude Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review

Clean, well-scoped dependency-only PR that unblocks the pnpm audit --audit-level=high merge gate. Only package.json and pnpm-lock.yaml change — no application code touched.

Code quality / best practices

  • Good use of pnpm.overrides to force resolution of nested/transitive copies (e.g. sharp pulled in separately via astro>sharp) rather than only bumping the direct dependency — the PR description correctly notes bumping the direct dep alone wasn't sufficient.
  • Scoping the fix to only high/critical findings (and explicitly deferring the astro 6→7 major and @astrojs/rss moderate bump) is the right call — it keeps blast radius small and avoids bundling an unrelated major upgrade with a security fix. Worth opening a follow-up issue for the remaining moderate/low findings and the astro major so they don't get forgotten.
  • PR description is exemplary: root-cause table, before/after audit counts, and an explicit local verification checklist (build, image pipeline, lint/format, Playwright, custom CI scripts).

Potential bugs / issues

  • Minor, low-risk: sharp@0.35.3's @img/sharp-win32-ia32 optional binary declares engines.node: ^20.9.0 (no >=), which technically excludes Node 22+ on that one platform/arch combo. Given the repo's engines.node: >=22.0.0 and that this is an optional binary only relevant to 32-bit Windows, this is very unlikely to matter in practice (and looks like an upstream sharp packaging quirk, not something introduced by this PR) — just flagging for awareness, not a blocker.
  • No functional/application code changed, so regression risk is inherently low. The postcss, js-yaml, and brace-expansion overrides are new and force-unify versions across the whole tree — reasonable given they're widely-depended-on transitive packages, and the PR confirms pnpm build + astro check + lint/format all pass against the new resolutions.

Performance

  • No performance concerns — these are patch/minor version bumps in tooling and image-processing dependencies, not runtime application code.

Security

  • This is the security fix: reduces pnpm audit --audit-level=high findings from 24 (12 high, 1 critical) to 5 (0 high/critical), which is exactly what was blocking the CI merge gate. The rationale table mapping each override to the vulnerable range is clear and the fix targets root cause (stale/pinned overrides) rather than symptoms.

Test coverage

  • No new tests needed for a dependency bump; the PR description documents thorough local verification (pnpm audit, pnpm build including WebP/OG image generation via the sharp-dependent pipeline, eslint, prettier --check, full Playwright suite with 65 passing, and the repo's custom check-agent-docs-sync/check-claude-assets/check-post-classification scripts). Given sharp had a minor version bump (0.34→0.35) and is exactly the package this repo's build-time image optimization depends on (per CLAUDE.md), the extra focus on verifying the image pipeline output was the right call.

Overall: solid, well-documented, appropriately-scoped fix. No blocking issues found.

@CaesiumY
CaesiumY merged commit 57f87d2 into main Jul 28, 2026
3 checks passed
@CaesiumY
CaesiumY deleted the chore/audit-transitive-deps branch August 22, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant