diff --git a/changelog.d/fixes/sec-adm-zip-codeql-host-match.md b/changelog.d/fixes/sec-adm-zip-codeql-host-match.md new file mode 100644 index 0000000000..e1b3a8f4dc --- /dev/null +++ b/changelog.d/fixes/sec-adm-zip-codeql-host-match.md @@ -0,0 +1 @@ +- fix(security): bump adm-zip to ^0.6.0 (dev transitive via promptfoo/onnxruntime-node) to clear the crafted-ZIP 4GB-allocation advisory, and tighten mitm DNS test host assertions to exact/suffix matching (CodeQL js/incomplete-url-substring-sanitization) diff --git a/package-lock.json b/package-lock.json index c5b8978f8a..1df6e56204 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13072,14 +13072,14 @@ } }, "node_modules/adm-zip": { - "version": "0.5.18", - "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.18.tgz", - "integrity": "sha512-ufJnssQGbxzLNS1Ho9bCtX4rQKCCvoVuDLHoJyc3F9dOGDB4BkWs2Ci0kv53lqocAEQ/Cbi+I2XCsNYGqVYqng==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.6.0.tgz", + "integrity": "sha512-XleryMhbuksdKtofnWZ9Sk+4CUTbms4Mb/EU32SZwToAyZ5RgVos/ki8n+yr0LWHOGKuakbXTuuYNHLQjhddgg==", "dev": true, "license": "MIT", "optional": true, "engines": { - "node": ">=12.0" + "node": ">=14.0" } }, "node_modules/afinn-165": { diff --git a/package.json b/package.json index 28e75a4077..4890100535 100644 --- a/package.json +++ b/package.json @@ -406,6 +406,7 @@ }, "node-gyp": { "undici": "^6.27.0" - } + }, + "adm-zip": "^0.6.0" } } diff --git a/tests/unit/mitm-dns-graceful-degrade-6127.test.ts b/tests/unit/mitm-dns-graceful-degrade-6127.test.ts index 4f71925d6f..c5937d5dd6 100644 --- a/tests/unit/mitm-dns-graceful-degrade-6127.test.ts +++ b/tests/unit/mitm-dns-graceful-degrade-6127.test.ts @@ -80,7 +80,7 @@ test("provisionDnsEntries: a failing agent/custom step does not stop the others }, addHostsDns: async (hosts: string[]) => { // Custom-hosts call must still happen even after default + agent errors. - if (hosts.includes("custom.example.com")) customCalled = true; + if (hosts.some((h) => h === "custom.example.com")) customCalled = true; }, getAgentStates: () => [{ dns_enabled: true, agent_id: "__nonexistent_agent__" }] as never, listEnabledCustomHosts: () => [{ host: "custom.example.com" }] as never, @@ -205,8 +205,8 @@ test("provisionDnsEntries: canElevate() returning true proceeds with DNS provisi }, addHostsDns: async (hosts: string[], sudoPassword: string) => { capturedPasswords.push(sudoPassword); - if (hosts.some((h) => h.includes("googleapis.com"))) agentCalled = true; - if (hosts.includes("custom.example.com")) customCalled = true; + if (hosts.some((h) => h.endsWith(".googleapis.com"))) agentCalled = true; + if (hosts.some((h) => h === "custom.example.com")) customCalled = true; }, canElevate: () => true, getAgentStates: () => [{ dns_enabled: true, agent_id: "antigravity" }] as never,