[agent] chore(deps): override nanoid to ^3.3.11 to fix CVE-2021-23566#728
Draft
github-actions[bot] wants to merge 1 commit intomainfrom
Draft
[agent] chore(deps): override nanoid to ^3.3.11 to fix CVE-2021-23566#728github-actions[bot] wants to merge 1 commit intomainfrom
github-actions[bot] wants to merge 1 commit intomainfrom
Conversation
Add npm overrides to force nanoid >= 3.3.11 across the dependency tree, resolving GHSA-qrpm-p2h7-hrv2 / CVE-2021-23566 (medium, score 5.5). The vulnerable nanoid 3.1.20 was transitively introduced by mocha@8.4.0 which pins it exactly. Since mocha 8.x is the latest 8.x release and upgrading to mocha 9.x/10.x would require touching 27 workspace package.json files with a major-version bump, an npm overrides entry in the root package.json is used as the fallback to pin nanoid to API-compatible with mocha's usage of the 3.x series. Closes Dependabot alert #1. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.
Summary
Fixes Dependabot alert #1 — GHSA-qrpm-p2h7-hrv2 / CVE-2021-23566 (medium, CVSS 5.5).
Vulnerability:
nanoid >= 3.0.0, < 3.1.31leaks the previously generated ID viavalueOf(), exposing sensitive information to unauthorized actors (CWE-200).Changes
"overrides": { "nanoid": "^3.3.11" }to the rootpackage.jsonpackage-lock.json:nanoidbumped from3.1.20→3.3.12(safe); thepostcss-specific nestednanoid@3.3.11entry was deduplicated into the single hoisted3.3.12entryWhy overrides (not a direct manifest bump)
The vulnerable
nanoid@3.1.20is introduced transitively bymocha@8.4.0, which pins it exactly.mocha@8.4.0is the last 8.x release — there is no 8.x mocha that ships a patched nanoid.Upgrading to
mocha@9.x/10.x(which shipnanoid ≥ 3.2.0) is a major-version bump that would require editing 27 workspacepackage.jsonfiles and validating the full test suite — a large, risky change for a medium-severity dev-only advisory.nanoid@3.3.12is fully API-compatible with mocha 8's usage of the 3.x series (postcssin this repo was already using3.3.11without issues).Alert reference