Skip to content

fix(security): update nanoid for CVE-2026-67214 - #1299

Merged
seonghobae merged 1 commit into
developfrom
fix/nanoid-cve-2026-67214
Aug 9, 2026
Merged

seonghobae merged 1 commit into
developfrom
fix/nanoid-cve-2026-67214

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

RCA

Protected develop at bf5870d9551773bf96b85294354a4d55fa9bf098 resolves postcss@8.5.24 -> nanoid@3.3.17. The later GitHub advisory GHSA-28wg-ghj8-5hjv / CVE-2026-67214 classifies that version as vulnerable: the non-secure generators can loop indefinitely when an attacker supplies a negative size.

The first failing production boundary is the protected frontend lock graph consumed by frozen installs. Immediate cause: 3.3.17 fixed the earlier zero-size issue but predates the negative-size correction. Systemic control: the existing lock regression test asserted the earlier fixed floor as an exact version, so this PR advances that machine-checkable contract instead of adding a waiver or weakening the security gate.

Minimal remedy

  • update the existing transitive resolution from nanoid@3.3.17 to the first fixed 3.x release, 3.3.18;
  • advance the existing mutation-sensitive lock contract to 3.3.18;
  • record the advisory and maturity truth in CHANGELOG.md.

This preserves PostCSS and the 3.x compatibility surface. It does not introduce a 5.x override, change application behavior, alter workflow policy, or suppress Trivy/dependency-review/OSV evidence.

TDD and verification

RED on exact base:

  • backend/.venv/bin/python -m pytest -q backend/tests/test_frontend_nanoid_security.py failed because both lock sections still contained nanoid@3.3.17.

GREEN on candidate tree ff282035f2e23679bc5b41783b7708f00523b005:

  • focused + release governance: 38 passed;
  • frontend Vitest: 49 files / 427 tests passed;
  • TypeScript tsc --noEmit: passed;
  • pnpm 11.5.3 frozen lock validation and supply-chain policy: passed;
  • pnpm audit --prod --audit-level high: no known vulnerabilities;
  • git diff --check: passed.

The hosted exact-head Security Scan/Trivy, dependency review, OSV, SAST, application CI, and independent current-head review remain authoritative. Merge only if the unchanged head passes repository policy; queued, predecessor-head, stale-base, status-only, or synthetic-merge evidence is not acceptance.

Summary by CodeRabbit

  • Bug Fixes
    • Updated PostCSS Nano ID to version 3.3.18, addressing a high-severity infinite-loop denial-of-service vulnerability involving negative sizes.
    • Added release checks to ensure the patched version remains in use.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0c98fe14-c7ba-42c5-9133-7380d70b5bbc

📥 Commits

Reviewing files that changed from the base of the PR and between bf5870d and b687150.

⛔ Files ignored due to path filters (1)
  • frontend/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • CHANGELOG.md
  • backend/tests/test_frontend_nanoid_security.py

📝 Walkthrough

Walkthrough

The PR raises the required Nano ID version from 3.3.17 to 3.3.18 and adds a changelog entry for the related PostCSS Nano ID security update.

Changes

Nano ID security update

Layer / File(s) Summary
Update Nano ID security requirement
backend/tests/test_frontend_nanoid_security.py, CHANGELOG.md
The security test now requires Nano ID 3.3.18. The changelog records the update and synchronized governance requirement.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related issues

Possibly related PRs

Suggested labels: dependencies, javascript

Suggested reviewers: claude

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the security fix and the Nano ID dependency update, which matches the main change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/nanoid-cve-2026-67214

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact current head b687150997dd81c4a60ca6199424f7a60c2beb90, including the frozen-lock advisory floor, mutation-sensitive regression, and unchanged PostCSS compatibility surface.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

@seonghobae I will review PR #1299 at commit b687150997dd81c4a60ca6199424f7a60c2beb90. I will verify the frozen-lock advisory floor, the mutation-sensitive regression, and PostCSS compatibility.

⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Fresh review-only request for exact current head b687150997dd81c4a60ca6199424f7a60c2beb90 against protected develop@bf5870d9551773bf96b85294354a4d55fa9bf098. Please submit a formal exact-head verdict on the nanoid@3.3.18 advisory floor, frozen-lock mutation regression, unchanged PostCSS 8 compatibility surface, and six successful exact-head repository workflows. Do not mutate, merge, publish, release, or weaken gates.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="ContextualWisdomLab/naruon"
head="b687150997dd81c4a60ca6199424f7a60c2beb90"
base="bf5870d9551773bf96b85294354a4d55fa9bf098"

echo "== checked-out and requested commits =="
git rev-parse HEAD
git cat-file -t "$head"
git cat-file -t "$base"
git merge-base "$base" "$head"

echo "== changed files =="
git diff --name-status "$base" "$head"

echo "== focused diff =="
git diff --check "$base" "$head"
git diff --unified=80 "$base" "$head" -- \
  CHANGELOG.md \
  backend/tests/test_frontend_nanoid_security.py \
  pnpm-lock.yaml \
  package.json \
  pnpm-workspace.yaml

echo "== nanoid and postcss lock references at head =="
git grep -n -E 'nanoid@3\.3\.|nanoid:|postcss@8\.' "$head" -- \
  pnpm-lock.yaml backend/tests/test_frontend_nanoid_security.py package.json pnpm-workspace.yaml || true

echo "== relevant test file outline and contents =="
test_file=$(fd -a '^test_frontend_nanoid_security\.py$' backend/tests | head -n1)
if [ -n "$test_file" ]; then
  ast-grep outline "$test_file" --items all
  sed -n '1,260p' "$test_file"
fi

echo "== pull request metadata and exact-head check runs =="
gh pr view 1299 --repo "$repo" --json number,headRefOid,baseRefOid,state,isDraft,mergeable,statusCheckRollup,url \
  --jq '{number, url, state, isDraft, mergeable, headRefOid, baseRefOid, checks: [.statusCheckRollup[] | {name, status, conclusion, detailsUrl}]}'

echo "== workflow runs for requested head =="
gh run list --repo "$repo" --commit "$head" --limit 30 \
  --json databaseId,name,status,conclusion,event,headSha,workflowName,url,createdAt,updatedAt

Length of output: 32730


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="ContextualWisdomLab/naruon"
head="b687150997dd81c4a60ca6199424f7a60c2beb90"
base="bf5870d9551773bf96b85294354a4d55fa9bf098"

echo "== exact frontend lockfile diff =="
git diff --check "$base" "$head" -- frontend/pnpm-lock.yaml
git diff --unified=60 "$base" "$head" -- frontend/pnpm-lock.yaml

echo "== exact head: lock entries =="
git show "$head:frontend/pnpm-lock.yaml" \
  | rg -n -C 8 '(^  nanoid@3\.3\.(17|18):|^  postcss@8\.5\.24:|nanoid: 3\.3\.(17|18))'

echo "== base: lock entries =="
git show "$base:frontend/pnpm-lock.yaml" \
  | rg -n -C 8 '(^  nanoid@3\.3\.(17|18):|^  postcss@8\.5\.24:|nanoid: 3\.3\.(17|18))'

echo "== postcss-related change summary =="
git diff --word-diff=plain "$base" "$head" -- frontend/pnpm-lock.yaml \
  | rg -n -C 4 'postcss|nanoid' || true

echo "== selected exact-head workflow runs and jobs =="
for run_id in 31319362372 31319362410 31319362337 31319362414 31319361154 31319362403; do
  echo "-- run ${run_id} --"
  gh run view "$run_id" --repo "$repo" --json databaseId,name,headSha,event,status,conclusion,jobs,url \
    --jq '{databaseId,name,headSha,event,status,conclusion,url,jobs:[.jobs[]|{name,status,conclusion}]}'
done

Length of output: 19073


@seonghobae Formal verdict: no actionable findings.

I reviewed exact head b687150997dd81c4a60ca6199424f7a60c2beb90 against develop@bf5870d9551773bf96b85294354a4d55fa9bf098. The requested base is the merge base.

  • The diff changes only CHANGELOG.md, backend/tests/test_frontend_nanoid_security.py, and frontend/pnpm-lock.yaml.
  • The frozen lockfile replaces nanoid@3.3.17 with nanoid@3.3.18 in both packages and snapshots.
  • postcss@8.5.24 remains unchanged. Its snapshot changes only its Nano ID resolution to 3.3.18.
  • The regression test requires nanoid@3.3.18 as the sole Nano ID 3.x resolution in both lock sections. It also requires postcss@8.5.24 to resolve to 3.3.18. A mutation that restores 3.3.17, adds another Nano ID 3.x entry, or changes the PostCSS resolution fails this contract.
  • The GitHub checks show successful exact-head runs for Security Scan, Dependency Review, SAST Semgrep, Application CI, CodeQL, and Strix Security Scan.

The focused job-detail query returned a GitHub API 404. The earlier PR check and workflow-run queries independently confirmed each listed run as success for the requested exact SHA.

I did not modify, merge, publish, release, or weaken any gate.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@seonghobae
seonghobae merged commit d73369e into develop Aug 9, 2026
46 checks passed
@seonghobae
seonghobae deleted the fix/nanoid-cve-2026-67214 branch August 9, 2026 16:35
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