Skip to content

Commit 91cd48d

Browse files
revopushbotclaude
andcommitted
Fix parse-duration, serialize-javascript, and uuid CVEs (REV-43)
Clears three Dependabot advisories in the CLI: - parse-duration (CVE-2025-25283, ReDoS): bump 1.1.0 -> ^2.1.6. v2 is ESM-only, so require() yields the module namespace and the parser is `.default`; it returns null (not NaN) for unparseable input, and `?? 0` preserves the pre-v2 behaviour of treating that as 0. Verified byte-identical to v1 across 18 TTL inputs (compound, decimal, empty, garbage). Adds engines: node >=20.19.0, required for require(esm). - serialize-javascript (GHSA-5c6j-r48x-rmvq, RCE/DoS): overridden to ^7.0.5. Transitive via mocha (devDependency), never shipped to consumers; no 6.x patch exists. - uuid (CVE-2026-41907, ReDoS): overridden to ^11.1.1. Transitive via xcode, which has no fixed release; verified compatible with xcode's uuid.v4() usage. Verified: tsc clean; CLI boots (require(esm) OK); xcode.generateUuid() works; npm audit clear for all three. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 31ba240 commit 91cd48d

3 files changed

Lines changed: 31 additions & 26 deletions

File tree

package-lock.json

Lines changed: 20 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"jszip": "^3.10.1",
3737
"moment": "^2.29.4",
3838
"opener": "^1.5.2",
39-
"parse-duration": "1.1.0",
39+
"parse-duration": "^2.1.6",
4040
"plist": "^3.1.0",
4141
"progress": "^2.0.3",
4242
"prompt": "^1.3.0",
@@ -57,6 +57,13 @@
5757
"yargs": "^17.7.2",
5858
"yazl": "^2.5.1"
5959
},
60+
"overrides": {
61+
"serialize-javascript": "^7.0.5",
62+
"uuid": "^11.1.1"
63+
},
64+
"engines": {
65+
"node": ">=20.19.0"
66+
},
6067
"devDependencies": {
6168
"@types/express": "^4.17.17",
6269
"@types/jest": "^29.5.14",

script/command-parser.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1673,5 +1673,7 @@ function isDefined(object: any): boolean {
16731673
}
16741674

16751675
function parseDurationMilliseconds(durationString: string): number {
1676-
return Math.floor(parseDuration(durationString));
1676+
// parse-duration v2 is ESM: the parser is `.default`, and `?? 0` restores v1's
1677+
// handling of unparseable input (v2 returns null instead of 0).
1678+
return Math.floor(parseDuration.default(durationString) ?? 0);
16771679
}

0 commit comments

Comments
 (0)