Repository navigation
chore(lint): add eslint-plugin-node-security so timing-unsafe compares are caught before review - #8586
chore(lint): add eslint-plugin-node-security so timing-unsafe compares are caught before review#8586ofri-peretz wants to merge 1 commit into
Conversation
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by QodoAdd Node and Express security rules to ESLint
AI Description
Merge Risk
|
Code Review by Qodo
1. Security lint checks never run
|
|
Right, and the PR description says so: |
In #8572 we fixed the basic-auth password compare in
webaccess.tsso it no longer stops at the first differing character;no-timing-unsafe-comparefrom eslint-plugin-node-security found it, and I offered a follow-up to add the plugin to your lint setup. This is that follow-up.It adds
eslint-plugin-node-securitytosrc/.eslintrc.cjs(a devDependency plus one override, in the existing eslintrc format), together witheslint-plugin-express-securityandeslint-plugin-secure-coding, since the server is Express. The next timing-unsafe compare, unhandled stream error or similar is then caught at the editor or in CI instead of in review.Only the rules that are clean on the current code are on, including
no-timing-unsafe-compare. The recommended rules that misfire here are switched off in the config with a one-line reason each, and there are no inline disables. The only other edit is twoignorePatternsentries for vendored bundles (static/vendor/andstatic/js/vendors/jquery.ts, the latter next to the existingjquery.jsentry) that the security rules choke on or flag in third-party code.It also helps agents. This repo has an AGENTS.md and accepts AI-written changes, and when Claude Code, Cursor or Copilot write code here, these rule messages are written for an LLM: each one names the CWE, why it matters and the fix, so the agent corrects its own output in the same edit instead of a reviewer catching it.
Testing:
pnpm lintdoesn't run ondevelopat the moment (ESLint 10 no longer reads.eslintrc.*, which I also hit in #8572), so the new block takes effect once lint is restored. To check it anyway I ran ESLint 9 in eslintrc mode with the override from this file and a TypeScript 6 parser oversrc/(550 files). I did not run the full existing rule set:typescript-eslintdoesn't support TypeScript 7 yet. Problems reported by the three added plugins:UI changes
AI disclosure: drafted with AI assistance (Claude); I reviewed and tested the change.