cve-remediation
Skill742 starsChanged 4 months agoMITView on GitHub
Domain knowledge for remediating CVEs in the iTwin.js Rush monorepo — pnpm-config.json structure, fix strategies, validation, and audit workflows.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- rundeck/rundecktheir own version, first seen Oct 8, 2026
- microsoft/github-copilot-modernizationtheir own version, first seen Sep 22, 2026
- Geoffe-Ga/well-worn-toolstheir own version, first seen Jul 4, 2026
- bnaylor/agent_skillstheir own version, first seen Jun 20, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- rundeck/rundeck★ 6.4ksame name
- microsoft/github-copilot-modernization★ 48same name
- bnaylor/agent_skills★ 4same name
- Geoffe-Ga/well-worn-tools★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- api-promotionSkill
- backport-resolutionSkill
- merge-conflict-resolvingSkill
- pr-review-considerationsSkill
- test-suite-refactoringSkill
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 5 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 75
Always attempt fixes in this order.
- Very specific: line 84
If the declaration uses catalog:<name>, update globalCatalogs.<name>[<dependency>] in pnpm-config.json and keep the manifest reference.
- Very specific: line 85
Run rush update then rush audit to verify
- Distinctive: line 86
If no safe version range exists, fall through to globalOverride (document why)
- Very specific: line 90
Check existing overrides first: Before adding a new override, check if the package already has an entry in globalOverrides in …
- Very specific: line 91
Semver range update (try first): Update the direct parent's version range, in its catalog entry if cataloged or its package.json otherwise, …
- Very specific: line 92
Scoped globalOverride (last resort): Only if no safe parent version exists.
- Very specific: line 94
Use rush-pnpm why <package> to trace transitive dependency paths when the audit output truncates them.
- Distinctive: line 98
Only for non-production/dev-tooling risk.
- Distinctive: line 115
After any remediation change:
- Very specific: line 126
When direct dependency version ranges were changed in a package.json or a catalog entry:
- Distinctive: line 136
After remediation, Rush requires changelog entries:
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CVE Remediation in iTwin.js
This skill covers the domain knowledge for fixing security vulnerabilities in the iTwin.js Rush monorepo. It is referenced by the CVE audit agent, the merge-conflict-resolving skill, and the backport-resolution skill.
Key Files
| File | Purpose |
common/config/rush/pnpm-config.json | Shared catalogs, global dependency overrides, and audit exceptions |
common/config/rush/pnpm-lock.yaml | Resolved dependency tree (never manually edit) |
common/config/rush/common-versions.json | Rush version-consistency policy (preferredVersions) |
common/config/rush/repo-state.json | Auto-generated repo state (commit after catalog or common-version changes) |
<package>/package.json | Direct dependency declarations: literal ranges or catalog:<name> references |
pnpm-config.json Structure
This file has two conflict-prone sections:
globalOverrides
Forces specific dependency versions across the entire monorepo. Used when a transitive dependency cannot be updated via its parent's semver range.
{
"globalOverrides": {
"<package>": "<patched-version>",
"<package>@<range>": "<patched-version>"
}
}Each override should include a trailing comment with:
- The advisory URL (GHSA or CVE link)
- The dependency path that pulls in the vulnerable package
Illustrative example (always consult the current common/config/rush/pnpm-config.json before editing):
"globalOverrides": {
"rollup-plugin-copy>globby": "^11.0.0", // https://github.com/vladshcherbin/rollup-plugin-copy/issues/77
"elliptic": "^6.6.1", // https://github.com/advisories/GHSA-vjh7-7g9h-fjfh crypto-browserify>browserify-sign>elliptic
"fast-xml-parser": "^5.3.6", // https://github.com/advisories/GHSA-jmr7-xgp7-cmfj @google-cloud/storage > fast-xml-parser
"axios@<1.0.0": "^1.13.5", // https://github.com/advisories/GHSA-43fc-jf86-j433
"serialize-javascript": "^7.0.3" // https://github.com/advisories/GHSA-5c6j-r48x-rmvq mocha>serialize-javascript
}Important: This file uses JSONC (JSON with comments). The last entry in any object/array must NOT have a trailing comma. When adding entries, ensure the previously-last entry gets a comma added and the new last entry does not have one.
ignoreCves (Audit Exceptions)
Located under a nested path. Used only for dev-tooling dependencies with no production path.
{
"unsupportedPackageJsonSettings": {
"pnpm": {
"auditConfig": {
"ignoreCves": [
"CVE-XXXX-XXXXX" // https://advisory-url — dev-only reason
]
}
}
}
}Fix Strategy (Strict Order)
Always attempt fixes in this order. Do not skip to overrides without trying the earlier steps.
1. Classify: Direct vs Transitive
- Direct: The vulnerable package is listed in a project's
package.json - Transitive: The vulnerable package is pulled in by another dependency
2a. Direct Dependency Fix
- If the declaration uses
catalog:<name>, updateglobalCatalogs.<name>[<dependency>]inpnpm-config.jsonand keep the manifest reference. Otherwise, update the version range in the affectedpackage.json. - Run
rush updatethenrush auditto verify - If no safe version range exists, fall through to globalOverride (document why)
2b. Transitive Dependency Fix
- Check existing overrides first: Before adding a new override, check if the package already has an entry in
globalOverridesinpnpm-config.jsonto avoid conflicts or duplicates. - Semver range update (try first): Update the direct parent's version range, in its catalog entry if cataloged or its
package.jsonotherwise, to a version that resolves the transitive dep to a patched release. - Scoped globalOverride (last resort): Only if no safe parent version exists. Scope the override to only the vulnerable version range (e.g.,
"lodash@>=4.0.0 <=4.17.23": "^4.18.0") rather than overriding all versions blanket. This avoids interfering with future already-patched versions. Document why in the override comment.
Use rush-pnpm why <package> to trace transitive dependency paths when the audit output truncates them.
3. ignoreCves (Absolute Last Resort)
Only for non-production/dev-tooling risk. Requires:
- Explicit rationale in comment
- Advisory link
- Confirmation that the dependency has no production code path
Never ignore a Critical/High production-path CVE when a patch is available.
Severity Policy
| Severity | Action |
| Critical | Always fix or explicitly document blocker and risk |
| High | Fix unless unacceptable breakage; if deferred, create tracking issue |
| Moderate/Low | Defer and create tracking issue with recommendation |
Validation Workflow
After any remediation change:
rush update # Regenerate lock file
rush audit # Verify CVE is resolved (internally runs rush-pnpm audit --audit-level high)
rush build # Ensure no build breakage
rush test # Ensure no test regressionsNote: rush audit does not accept --level or --json flags directly. Use rush-pnpm why <package> to investigate specific dependency paths.
When direct dependency version ranges were changed in a package.json or a catalog entry:
rush extract-api # Check for API surface changesSkip extract-api only when the sole change is a globalOverride in pnpm-config.json.
Rush Change Files
After remediation, Rush requires changelog entries:
# Check if change files are needed
rush change --verify -b origin/<base-branch>
# If needed for internal dependency-only updates, create blank entries non-interactively
rush change --bulk --message "" --bump-type none -b origin/<base-branch>Change files land in common/changes/@itwin/<package>/ as JSON files with unique filenames.
common-versions.json
If a direct dependency bump triggers Rush consistency errors, resolve any catalog reference before comparing its range with common/config/rush/common-versions.json. Keep the catalog and any literal preferred baseline coordinated, following common/config/rush/README-dependencies.md; do not replace catalog references with literals or add broad exceptions to silence a mismatch. Always commit the auto-generated common/config/rush/repo-state.json hash update alongside policy changes.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

