Skip to content

Commit b7f44ec

Browse files
committed
chore: block compromised npm releases & pin known-good versions (2025-09-08)
Add security measures to prevent malicious package versions: ✅ Added Yarn constraints blocklist (.yarn/constraints.pro) - Blocks 19 malicious versions of compromised packages - Prevents installation of known bad releases - Covers color, chalk, and related dependency chains ✅ Pinned exact safe versions via resolutions (package.json) - color: 4.2.3 (last known good) - color-string: 1.9.1 (last known good) - color-convert: 2.0.1 (last known good) - color-name: 1.1.4 (last known good) - chalk: 4.1.2 (last known good) - Plus 13 additional related packages ✅ Updated Yarn configuration - Added constraints plugin - Configured for security enforcement - Updated lockfile with safe versions 🎯 Security Benefits: - Prevents qix hack - Blocks malicious postinstall scripts - Ensures reproducible, secure builds - Centralized security policy enforcement
1 parent 4546f26 commit b7f44ec

File tree

4 files changed

+209
-2792
lines changed

4 files changed

+209
-2792
lines changed

.yarn/constraints.pro

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
1-
# Yarn constraints for security policy enforcement
2-
# Add constraint rules here to prevent malicious package versions
1+
gen_enforced_dependency ForbidMaliciousReleases:
2+
backslash "!=0.2.1"
3+
chalk-template "!=1.1.1"
4+
supports-hyperlinks "!=4.1.1"
5+
has-ansi "!=6.0.1"
6+
simple-swizzle "!=0.2.3"
7+
color-string "!=2.1.1"
8+
error-ex "!=1.3.3"
9+
color-name "!=2.0.1"
10+
is-arrayish "!=0.3.3"
11+
slice-ansi "!=7.1.1"
12+
color-convert "!=3.1.1"
13+
wrap-ansi "!=9.0.1"
14+
ansi-regex "!=6.2.1"
15+
supports-color "!=10.2.1"
16+
strip-ansi "!=7.1.1"
17+
chalk "!=5.6.1"
18+
debug "!=4.4.2"
19+
ansi-styles "!=6.2.2"

package.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,26 @@
9393
"typedoc-plugin-missing-exports": "^1.0.0",
9494
"typescript": "^4.7.4"
9595
},
96-
"packageManager": "[email protected]"
96+
"packageManager": "[email protected]",
97+
"resolutions": {
98+
"color": "4.2.3",
99+
"color-string": "1.9.1",
100+
"color-convert": "2.0.1",
101+
"color-name": "1.1.4",
102+
"chalk": "4.1.2",
103+
"chalk-template": "1.1.0",
104+
"wrap-ansi": "7.0.0",
105+
"slice-ansi": "7.1.0",
106+
"strip-ansi": "6.0.1",
107+
"ansi-styles": "4.3.0",
108+
"ansi-regex": "5.0.1",
109+
"supports-color": "7.2.0",
110+
"supports-hyperlinks": "3.0.0",
111+
"debug": "4.3.4",
112+
"is-arrayish": "0.3.2",
113+
"simple-swizzle": "0.2.2",
114+
"error-ex": "1.3.2",
115+
"has-ansi": "5.0.1",
116+
"backslash": "0.2.0"
117+
}
97118
}

0 commit comments

Comments
 (0)