feat(lint): add CWE-tagged security rules - #145
Open
ofri-peretz wants to merge 1 commit into
Open
Conversation
Adds eslint-plugin-node-security and eslint-plugin-secure-coding as a block in eslint.config.mjs — 48 rules covering command injection, path traversal, unsafe deserialization and the crypto misuse patterns that apply to a Node library. Measured against this repository before proposing it: 0 findings across 4.5 KLOC. `eslint` exits 0 and all 106 tests pass, unchanged. Every message carries a CWE identifier and a CVSS score rather than a rule name.
ofri-peretz
force-pushed
the
feat/security-rules
branch
from
August 25, 2026 13:58
d4b65fd to
7602dc9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
A security block in
eslint.config.mjs— 48 rules fromeslint-plugin-node-securityandeslint-plugin-secure-coding, covering command injection, path traversal, unsafe deserialization and the crypto misuse patterns that apply to a Node library.It finds nothing here, and that is the point
I ran these rules against this repository before opening the PR: 0 findings across 4.5 KLOC.
eslintexits 0 and all 106 tests pass, unchanged. The diff adds no work.The ask is to keep it that way. A rule that is not enabled catches nothing on the day someone builds a shell command out of a template literal.
To show the rules are live rather than silently configured, a deliberate violation reports:
That one is worth having in a dashboard generator specifically: this library takes names and queries from callers and renders them into JSON, and the boundary between "template a dashboard" and "template a command" is the kind of thing a linter should be watching.
Every message carries a CWE identifier and a CVSS score rather than just a rule name, which is the form an audit asks for.
Notes
devDependencies; nothing is added to what consumers install.^5.2.1and^5.1.2.warn, or scope it tosrc/if you would rather adopt gradually.