diff --git a/cloud-sync.js b/cloud-sync.js index 7e44932b..322a95c6 100644 --- a/cloud-sync.js +++ b/cloud-sync.js @@ -740,7 +740,12 @@ function openReportModal() { // hand-edited files ever matter. export function parseMsProjectXml(xml) { const tag = (block, name) => { - const m = block.match(new RegExp(`<${name}>([^<]*)`)); + // `name` is always a hardcoded XML tag literal from the callers below + // (UID, Name, OutlineLevel, Start, Finish, ...), never user input, and the + // capture group `[^<]*` is a single linear character class with no nested + // or ambiguous quantifier, so this pattern cannot backtrack catastrophically + // regardless of `block` — there is no ReDoS surface. + const m = block.match(new RegExp(`<${name}>([^<]*)`)); // nosemgrep: javascript.lang.security.audit.detect-non-literal-regexp.detect-non-literal-regexp return m ? m[1].trim() : ''; }; const unescape = (s) => s diff --git a/package-lock.json b/package-lock.json index 21575e82..7abe7165 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "scopeweave", "version": "1.0.0", "dependencies": { - "@hono/node-server": "^1.19.14", + "@hono/node-server": "^2.0.12", "hono": "^4.12.27" }, "devDependencies": { @@ -17,12 +17,12 @@ } }, "node_modules/@hono/node-server": { - "version": "1.19.14", - "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.14.tgz", - "integrity": "sha512-GwtvgtXxnWsucXvbQXkRgqksiH2Qed37H9xHZocE5sA3N8O8O8/8FA3uclQXxXVzc9XBZuEOMK7+r02FmSpHtw==", + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.0.12.tgz", + "integrity": "sha512-eWpQYr67tqJLeaSUl0Q+TquuYfUdTibpOJlUMV2FfUP7+KqCC5TufnwnlXL6mobZBJbGAYRd7ZvEBDCbLInjhg==", "license": "MIT", "engines": { - "node": ">=18.14.1" + "node": ">=20" }, "peerDependencies": { "hono": "^4" diff --git a/package.json b/package.json index 9ae8b292..2f90e2a3 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "fuzz": "node --test tests/fuzz/*.mjs" }, "dependencies": { - "@hono/node-server": "^1.19.14", + "@hono/node-server": "^2.0.12", "hono": "^4.12.27" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bffabf92..5d7b7de5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@hono/node-server': - specifier: ^1.19.14 - version: 1.19.14(hono@4.12.28) + specifier: ^2.0.12 + version: 2.0.12(hono@4.12.28) hono: specifier: ^4.12.27 version: 4.12.28 @@ -24,9 +24,9 @@ importers: packages: - '@hono/node-server@1.19.14': - resolution: {integrity: sha512-GwtvgtXxnWsucXvbQXkRgqksiH2Qed37H9xHZocE5sA3N8O8O8/8FA3uclQXxXVzc9XBZuEOMK7+r02FmSpHtw==} - engines: {node: '>=18.14.1'} + '@hono/node-server@2.0.12': + resolution: {integrity: sha512-eWpQYr67tqJLeaSUl0Q+TquuYfUdTibpOJlUMV2FfUP7+KqCC5TufnwnlXL6mobZBJbGAYRd7ZvEBDCbLInjhg==} + engines: {node: '>=20'} peerDependencies: hono: ^4 @@ -63,7 +63,7 @@ packages: snapshots: - '@hono/node-server@1.19.14(hono@4.12.28)': + '@hono/node-server@2.0.12(hono@4.12.28)': dependencies: hono: 4.12.28 diff --git a/tests/unit/analytics.test.mjs b/tests/unit/analytics.test.mjs index 9f0163d1..7c6b5137 100644 --- a/tests/unit/analytics.test.mjs +++ b/tests/unit/analytics.test.mjs @@ -74,4 +74,22 @@ assert.ok(midIdx > 0 && Math.abs(s.planned[midIdx] - 0.5) < 1e-6, 'midpoint ≈ // empty / undated tasks → empty series, no throw assert.deepEqual(buildScurve({ tasks: [], calcPlannedRatio, calcDuration, buildTimeline }), { timeline: [], planned: [] }); +// dated tasks whose total duration is zero → empty series (no 0/0 NaN weight). +// Distinct from the empty-input case above: these tasks DO pass the "has both +// planned dates" filter, so they populate `dated`, but each contributes 0 days +// (end Number.isFinite(v)), 'no NaN in planned series'); + console.log('✓ analytics (EVM + S-curve) unit tests passed');