Skip to content
Esc

Benchmark

Rule tests only cover the cases each rule’s author thought of. The bench measures the rules against a separate labeled corpus: every vulnerable case has a safe twin of the same shape that differs only by its guard (an allowlist, a containment check, escaping, schema validation), so a rule that over-fires shows up as clearly as one that misses. The cases are written in Express, Koa, NestJS and plain Node shapes, in JavaScript and TypeScript.

Each plugin runs with its recommended preset. A rule the preset leaves off is switched on for its own category (“override” below), with default options unless the category says otherwise.

  • Detection: the share of vulnerable cases the rule reports on the labelled line (TP / (TP + FN)).
  • False alarms: the share of safe twins the rule reports anything in (FP / (FP + TN)).
  • J (Youden’s J): detection minus false alarms. 100% is perfect, 0% is no better than chance.
  • Extra: reports on an unlabelled line of a vulnerable case. Not in the four counts, and often a real false alarm on the code around the sink.
  • Elsewhere: safe cases of other categories the rule reported, out of those it ran on (a preset rule runs on all of them). They are recorded as false alarms, but kept out of the rates, which compare paired twins.

These rules are single-file and syntactic: they see one call at a time and no data flow across functions or files. Read a miss below as a statement of that scope, not a promise it will be fixed. CI fails when any recorded case gets worse than the committed baseline: no rule loses a catch or gains a false alarm, and no handled case is deleted, without an explicit flag that shows up in review. New cases can still lower a rate, because a case a rule misses may be added before the rule learns it.

@noctcore/eslint-plugin-security, every rule it exports:

Rule Enabled by TP FN FP TN Extra Detection False alarms J Elsewhere
noctcore-security/auth-cookie-flags override 10 24 0 34 0 29% 0% +29% 0 of 0
noctcore-security/bcrypt-rounds-min no cases yet
noctcore-security/no-shell-interpolation recommended 39 5 8 37 1 89% 18% +71% 0 of 196
noctcore-security/no-timing-unsafe-compare no cases yet
noctcore-security/no-unescaped-html-response override 36 0 0 40 0 100% 0% +100% 0 of 0
noctcore-security/no-user-controlled-fetch-url recommended 30 7 9 28 0 81% 24% +57% 0 of 204
noctcore-security/no-user-controlled-redirect recommended 31 9 7 33 0 78% 18% +60% 0 of 201
noctcore-security/presigned-post-requires-policy no cases yet
noctcore-security/require-path-containment override 27 15 3 42 2 64% 7% +58% 0 of 0
noctcore-security/require-sanitized-html override 9 23 0 40 0 28% 0% +28% 0 of 0
noctcore-security/server-action-through-client no cases yet
Category CWE Pairs TP FN FP TN Extra Detection False alarms J
Command injection CWE-78 44 39 5 8 37 1 89% 18% +71%
Cookie flags - 34 10 24 0 34 0 29% 0% +29%
Open redirect CWE-601 40 31 9 7 33 0 78% 18% +60%
Path traversal CWE-22 42 27 15 3 42 2 64% 7% +58%
Server-side XSS CWE-79 40 45 23 0 80 0 66% 0% +66%
Server-side request forgery CWE-918 37 30 7 9 28 0 81% 24% +57%

Catches (10)

Misses (24)

Wrongly reports (safe code) (0)

  • none

Catches (39)

Misses (5)

Wrongly reports (safe code) (8)

Catches (36)

Misses (0)

  • none

Wrongly reports (safe code) (0)

  • none

Catches (30)

Misses (7)

Wrongly reports (safe code) (9)

Catches (31)

Misses (9)

Wrongly reports (safe code) (7)

Catches (27)

Misses (15)

Wrongly reports (safe code) (3)

Catches (9)

Misses (23)

Wrongly reports (safe code) (0)

  • none