Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

test(scan): cover imported finding paths before persistence (#866)

kevin93b404caeae9
diff --git a/sdk/typescript/tests-ts/import-scan.test.ts b/sdk/typescript/tests-ts/import-scan.test.ts
index 601bafc34..d52a15efe 100644
--- a/sdk/typescript/tests-ts/import-scan.test.ts
+++ b/sdk/typescript/tests-ts/import-scan.test.ts
@@ -721,6 +721,19 @@ for (const dryRun of [false, true]) {
},
],
["duplicate evidence ID", { codeEvidence: [evidence, evidence] }],
+ [
+ "unsafe secondary location",
+ {
+ locations: [
+ { path: "src/extract.ts", startLine: 41 },
+ { path: "../outside.ts", startLine: 1 },
+ ],
+ },
+ ],
+ [
+ "unsafe evidence path",
+ { codeEvidence: [{ ...evidence, path: "../outside.ts" }] },
+ ],
] as const)(
`rejects %s before import persistence (dryRun: ${dryRun})`,
async (_name, details) => {