diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts index 71c9900..a70e13a 100644 --- a/apps/api/src/index.ts +++ b/apps/api/src/index.ts @@ -101,6 +101,7 @@ app.get('*', serveStatic({ path: './public/index.html' })); function isMainModule(): boolean { if (!process.argv[1]) return false; try { + // eslint-disable-next-line security/detect-non-literal-fs-filename -- process.argv[1] is the Node runtime entry path, not user input return fileURLToPath(import.meta.url) === realpathSync(process.argv[1]); } catch { return false; diff --git a/apps/api/tests/broker/expand.test.ts b/apps/api/tests/broker/expand.test.ts index 52c9641..1495fe3 100644 --- a/apps/api/tests/broker/expand.test.ts +++ b/apps/api/tests/broker/expand.test.ts @@ -25,6 +25,7 @@ const __dirname = dirname(fileURLToPath(import.meta.url)); const FIXTURES = join(__dirname, '../fixtures'); function loadFixture(name: string): string { + // eslint-disable-next-line security/detect-non-literal-fs-filename -- name is a test-controlled fixture filename, not user input return readFileSync(join(FIXTURES, name), 'utf8'); } diff --git a/eslint.config.js b/eslint.config.js index 27dc0cc..b9ff8f7 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -106,16 +106,18 @@ export default tseslint.config( }, // ── 5. eslint-plugin-security: blocking errors per D-03 ────────────────── - // Applied to all TS/TSX files in both apps. - // 15 rules active at error level — heuristic, noisy on obj[key] patterns. - // detect-object-injection disabled globally: very high false-positive rate on - // Drizzle ORM bracket access and TypeScript generics; real user-controlled key - // risks are guarded by zod validation — see Task 2 triage notes. + // Applied to all TS/TSX files in both apps. 14 of 15 rules active at error. + // detect-object-injection is disabled globally: it fires on every obj[key] + // pattern including numeric array index access (e.g. arr[i] in loops). + // After triage: all hits are schema-derived or numeric loop counters — not + // user-controlled keys. Real user-controlled input is guarded by zod + // validation at API boundaries. Disabling one rule; the remaining 14 enforce. { files: ['apps/**/*.{ts,tsx}'], ...pluginSecurity.configs.recommended, rules: { ...pluginSecurity.configs.recommended.rules, + 'security/detect-object-injection': 'off', // High FP: all hits are numeric loop indices or schema-derived keys, not user input }, },