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.
security
Section titled “security”@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% |
security/auth-cookie-flags
Section titled “security/auth-cookie-flags”Catches (10)
- cookie flags object only built in production, spread as undefined elsewhere (express, express-conditional-flags.vuln.ts)
- exported cookie defaults spread into the session cookie, open to change by any importer (express, express-exported-defaults.vuln.ts)
- session id cookie written with no flags at login (express, express-login-session.vuln.js)
- auth token cookie set after login with only maxAge, rewritten by via-spread (express, express-preferences-auth-token-via-spread.vuln.js)
- auth token cookie set after login with only maxAge (express, express-preferences-auth-token.vuln.js)
- shared cookie flags object has httpOnly turned off in place before it is spread (express, express-shared-flags-mutated.vuln.js)
- login controller sets session cookie with only maxAge (nest, nest-login-controller.vuln.ts)
- fastify magic link session cookie missing sameSite (nest, nest-magic-link-fastify.vuln.ts)
- oauth callback cookie uses shared options without httpOnly (nest, nest-oauth-shared-const.vuln.ts)
- auth token cookie set with no flags after login (nest, nest-session-auth-token.vuln.ts)
Misses (24)
- express-session cookie with sameSite none and no secure (express, express-connect-sid-samesite.vuln.js)
- cookie-session middleware with httpOnly false (express, express-cookie-session.vuln.js)
- impersonation session cookie built in a variable without httpOnly (express, express-impersonation.vuln.ts)
- jwt cookie written readable by scripts after magic link (express, express-magic-link-jwt.vuln.ts)
- oauth callback stores access token with shared options lacking httpOnly (express, express-oauth-callback-shared.vuln.js)
- refresh token cookie rotated with httpOnly false (express, express-refresh-rotation.vuln.js)
- remember-me cookie with sameSite none and no httpOnly (express, express-remember-me.vuln.ts)
- express-session cookie config with secure false (express, express-session-config.vuln.js)
- impersonation cookie with sameSite none and no secure (koa, koa-impersonation.vuln.ts)
- session id cookie set with no options (koa, koa-login-sid.vuln.js)
- magic link verification sets auth cookie with only overwrite (koa, koa-magic-link.vuln.js)
- oauth callback cookie spreads shared defaults and turns httpOnly off (koa, koa-oauth-callback.vuln.js)
- refresh token cookie set with httpOnly false (koa, koa-refresh-token.vuln.js)
- koa-session config with secure false (koa, koa-session-config.vuln.js)
- token cookie set with default options on login (koa, koa-settings-token.vuln.ts)
- impersonation access token cookie with secure false (nest, nest-impersonation.vuln.ts)
- fastify refresh token cookie with httpOnly false (nest, nest-refresh-fastify.vuln.ts)
- remember-me cookie missing httpOnly (nest, nest-remember-me.vuln.ts)
- auth token header cookie without Secure attribute (node, node-header-no-secure.vuln.js)
- set-cookie header with session token and only a path (node, node-header-session.vuln.js)
- cookie package serialize with httpOnly false for access token (node, node-serialize-httponly-false.vuln.ts)
- cookie package serializes a jwt with only path and sameSite (node, node-serialize-jwt.vuln.ts)
- cookie package serializes refresh token with only a path (node, node-serialize-refresh.vuln.js)
- session header cookie written with only a path (node, node-session-header.vuln.ts)
Wrongly reports (safe code) (0)
- none
security/no-shell-interpolation
Section titled “security/no-shell-interpolation”Catches (39)
- uploaded file name from the body interpolated into a promisified exec, rewritten by import-alias (express, express-convert-image-import-alias.vuln.js)
- uploaded file name from the body interpolated into a promisified exec (express, express-convert-image.vuln.js)
- query fields destructured into a config object that feeds a git exec call (express, express-destructured-config-write.vuln.js)
- domain route param interpolated into execSync nslookup (express, express-dns-lookup.vuln.ts)
- input path from the body interpolated into spawnSync with shell true (express, express-ffmpeg-thumb.vuln.js)
- branch name from the query string interpolated into a git exec call (express, express-git-checkout-branch.vuln.js)
- line count from the query interpolated into tail via a namespace import (express, express-log-tail.vuln.js)
- script name from the query passed in the args array of spawn with a shell on Windows (express, express-npm-script-spawn.vuln.ts)
- host from the request body concatenated onto a ping command (express, express-ping-host.vuln.ts)
- service name from the route interpolated into a PowerShell -Command argument (express, express-powershell-service.vuln.ts)
- report name allowed to hold % put into a command that cmd.exe runs on Windows (express, express-report-hash-windows.vuln.ts)
- folder from the query built into a command string run with sh -c (express, express-tar-backup.vuln.js)
- nested workspace path whose pattern admits both / and . removed with rm -rf under /srv (express, express-workspace-cleanup.vuln.ts)
- url from the request body interpolated into an exec curl call (koa, koa-curl-fetch.vuln.js)
- record name checked by a pattern that lets a leading + through, then built into a dig command (koa, koa-dig-name.vuln.js)
- name from the query interpolated into sh -c args picked by a ternary and built with a spread (koa, koa-dig-trace.vuln.js)
- author from ctx.query concatenated into an execSync git log (koa, koa-git-log-author.vuln.ts)
- author filter from the query appended to a git log command held in a let, then execSync (koa, koa-git-log-filter.vuln.js)
- package name from ctx.params interpolated into spawn with shell true (koa, koa-npm-view-package.vuln.ts)
- runner picked from a list that holds npx, so the checked script name runs as a package (koa, koa-run-script-runner.vuln.js)
- domain from ctx.query interpolated into a promisified exec (koa, koa-whois-lookup.vuln.js)
- file name from the body built into an execFile sh -c script (koa, koa-zip-export.vuln.js)
- route param reaches an injectable service that execs a pg_dump string (nest, nest-backup-service.vuln.ts)
- DTO domain from @Body built into a command run with spawn sh -c (nest, nest-dig-records.vuln.ts)
- tag from @Param interpolated into execSync git show (nest, nest-git-tag.vuln.ts)
- width from @Query interpolated into an exec ImageMagick call (nest, nest-image-resize.vuln.ts)
- host from @Query concatenated into an exec ping, rewritten by import-alias (nest, nest-ping-controller-import-alias.vuln.ts)
- host from @Query concatenated into an exec ping (nest, nest-ping-controller.vuln.ts)
- DTO name field from @Body interpolated into an exec call (nest, nest-report-dto.vuln.ts)
- service name from @Query interpolated into cp.exec systemctl restart (nest, nest-service-restart.vuln.ts)
- exported handler interpolates a request supplied directory into execSync tar (node, node-cli-archive-handler.vuln.js)
- exported handler builds a cat and grep pipeline from a payload file path in a const, then execSync (node, node-dhcp-leases-pipeline.vuln.js)
- exported handler interpolates a request target into a promisified exec rsync (node, node-handler-rsync.vuln.ts)
- x-target header concatenated into execSync curl in a node:http server (node, node-http-curl-health.vuln.js)
- domain from URL searchParams interpolated into exec in a node:http server (node, node-http-nslookup.vuln.js)
- user from URL searchParams interpolated into exec ps in a node:http server (node, node-http-ps-filter.vuln.ts)
- npm path from the environment and caller arguments run through cmd.exe /c with execFileSync (node, node-npm-runner-windows.vuln.ts)
- exported handler passes a command built from a payload ref to a local execSync helper (node, node-shell-helper-describe.vuln.ts)
- JSON body field built into a script run with spawn bash -c (node, node-webhook-script.vuln.js)
Misses (5)
- environment header interpolated into execaCommand deploy script (express, express-header-deploy.vuln.ts)
- url from the body flows through a command builder helper into exec (express, express-pdf-render.vuln.ts)
- search term from the query interpolated into shelljs exec (express, express-shelljs-grep.vuln.js)
- file name from the body interpolated into execaCommand libreoffice (koa, koa-convert-doc.vuln.js)
- directory param flows through a command helper into exec (koa, koa-disk-usage.vuln.js)
Wrongly reports (safe code) (8)
- domain validated by an anchored hostname regex before execSync (express, express-dns-lookup.safe.ts)
- line count parsed and range checked before interpolating into tail (express, express-log-tail.safe.js)
- host checked against a const allowlist, then concatenated into exec (express, express-ping-host.safe-2.ts)
- package name validated by regex, then interpolated into spawn with shell (koa, koa-npm-view-package.safe.ts)
- tag validated by regex with BadRequestException before execSync (nest, nest-git-tag.safe.ts)
- width parsed with parseInt and range checked before the exec call (nest, nest-image-resize.safe.ts)
- DTO name field restricted by @Matches under ValidationPipe, then interpolated (nest, nest-report-dto.safe.ts)
- x-target header parsed as a URL and host checked with Set.has before execSync (node, node-http-curl-health.safe.js)
security/no-unescaped-html-response
Section titled “security/no-unescaped-html-response”Catches (36)
- comment preview echoes the posted comment body (express, express-comment-preview.vuln.ts)
- error page echoes the :page route param unescaped (express, express-error-page-param.vuln.ts)
- profile page calls the shared helper object after its escaper was replaced through the prototype (express, express-helper-object.vuln.js)
- search page wraps the raw query in a shared layout helper (express, express-layout-search.vuln.ts)
- posted markdown rendered with marked and sent as HTML (express, express-markdown-render.vuln.js)
- profile page renders stored user bio as raw HTML (express, express-profile-bio.vuln.js)
- server-rendered React page injects bio via dangerouslySetInnerHTML (express, express-react-bio.vuln.tsx)
- React comment list sets __html from the request body (express, express-react-comment.vuln.jsx)
- React search page marks up the raw query through __html, rewritten by callback (express, express-react-search-callback.vuln.tsx)
- React search page marks up the raw query through __html (express, express-react-search.vuln.tsx)
- sanitized signature markup overwritten with the raw draft for preview (express, express-react-signature.vuln.tsx)
- HTML report concatenates customer name into markup (express, express-report-email.vuln.ts)
- search page echoes the raw query into HTML (express, express-search-echo.vuln.js)
- inline state is serialized into a single-quoted JSON.parse string (express, express-state-script.vuln.ts)
- error middleware echoes the requested path (koa, koa-error-handler.vuln.ts)
- flash route returns plain text on success and the raw message as HTML otherwise (koa, koa-flash-message.vuln.js)
- markdown preview sends marked output unfiltered (koa, koa-markdown-preview.vuln.ts)
- newsletter preview escapes its fields, then decodes the entities of the whole page (koa, koa-newsletter-preview.vuln.ts)
- profile route renders stored bio into the page (koa, koa-profile-page.vuln.js)
- server-rendered React card puts the headline in __html (koa, koa-react-card.vuln.jsx)
- search page sets ctx.body with the raw query (koa, koa-search-body.vuln.js)
- echo route sends the note as text/html (koa, koa-text-plain.vuln.ts)
- posted comment is wrapped in HTML and sent with res.send (nest, nest-comment-preview.vuln.ts)
- handler writes the failed id into an error page via res.send (nest, nest-error-res-send.vuln.ts)
- handler with no Header decorator returns markup with the raw name (nest, nest-greeting-default.vuln.ts)
- search endpoint returns an HTML string built from the query (nest, nest-json-search.vuln.ts)
- markdown body converted by marked and returned as HTML (nest, nest-markdown-render.vuln.ts)
- profile endpoint renders the stored bio into HTML (nest, nest-profile-bio.vuln.ts)
- controller returns a search page string with the raw query (nest, nest-search-header.vuln.ts)
- error page streams the request path with res.write (node, node-error-write.vuln.ts)
- meta refresh puts the escaped next parameter at the start of its URL (node, node-meta-refresh.vuln.js)
- profile server interpolates the stored bio into HTML (node, node-profile-bio.vuln.js)
- shared DOMPurify config allows onerror before the preview is sanitized (node, node-purify-setconfig.vuln.js)
- node server renders React with the bio set through __html (node, node-react-profile.vuln.jsx)
- report page concatenates the title query into HTML (node, node-report-concat.vuln.ts)
- http server ends the response with the query in HTML (node, node-search-end.vuln.js)
Misses (0)
- none
Wrongly reports (safe code) (0)
- none
security/no-user-controlled-fetch-url
Section titled “security/no-user-controlled-fetch-url”Catches (30)
- gateway appends the path query to the API origin without a slash (express, express-api-path.vuln.js)
- image proxy streams the src query parameter through axios, rewritten by via-spread (express, express-image-proxy-via-spread.vuln.js)
- image proxy streams the src query parameter through axios (express, express-image-proxy.vuln.js)
- link preview fetches whatever URL the client posts (express, express-link-preview.vuln.js)
- https.get receives a URL object built from the target body field (express, express-new-url.vuln.js)
- PDF renderer fetches the page URL from the body with axios config (express, express-pdf-render.vuln.ts)
- report relay hands the posted request options to https.request (express, express-report-relay.vuln.ts)
- stored webhook URL is read back from the db and posted to (express, express-saved-webhook.vuln.js)
- status check interpolates the host query parameter into the URL (express, express-status-host.vuln.js)
- webhook tester posts a payload to the callbackUrl in the body (express, express-webhook-test.vuln.js)
- avatar fetch interpolates the host query value into the URL (koa, koa-avatar-fetch.vuln.js)
- export job appends the path query to a runtime upstream base (koa, koa-export-callback.vuln.ts)
- image proxy passes the src query value to node-fetch (koa, koa-image-proxy.vuln.ts)
- unfurl fetches the url field of the koa request body (koa, koa-link-unfurl.vuln.js)
- saved integration URL is loaded from the db and requested (koa, koa-saved-integration.vuln.ts)
- settings endpoint sets the axios default base URL from the request body (koa, koa-upstream-settings.vuln.js)
- webhook ping posts to the endpoint URL from the request body (koa, koa-webhook-ping.vuln.js)
- feed probe calls the DTO url through an alias of axios (nest, nest-feed-probe.vuln.ts)
- PDF renderer fetches a URL object built from the DTO page (nest, nest-pdf-render.vuln.ts)
- health probe interpolates the host query into the URL (nest, nest-status-host.vuln.ts)
- webhook tester calls fetch with the DTO callbackUrl (nest, nest-webhook-tester.vuln.ts)
- passthrough appends the raw request path to the API origin (node, node-api-passthrough.vuln.ts)
- avatar import calls axios.get with the href of a URL built from the query (node, node-avatar-import.vuln.js)
- image proxy pipes https.get on the src query value (node, node-image-proxy.vuln.ts)
- http server fetches the url query parameter (node, node-link-preview.vuln.js)
- mirror health check opens an undici Pool on the origin from the query (node, node-mirror-pool.vuln.js)
- snapshot fetches any URL whose host matches a regex that ends in github.io (node, node-pages-snapshot.vuln.js)
- status check interpolates the host query into the request URL (node, node-status-check.vuln.js)
- relay reads a JSON body and posts to its url field, rewritten by via-spread (node, node-webhook-relay-via-spread.vuln.js)
- relay reads a JSON body and posts to its url field (node, node-webhook-relay.vuln.js)
Misses (7)
- avatar import downloads from the avatarUrl in the body (express, express-avatar-import.vuln.ts)
- feed reader requests the feed URL from the query with undici (express, express-feed-reader.vuln.ts)
- feed import downloads the feed URL in the body with got (koa, koa-feed-import.vuln.js)
- feed reader requests a subscription URL stored by the user (nest, nest-feed-reader.vuln.ts)
- image import downloads the DTO imageUrl through HttpService (nest, nest-image-import.vuln.ts)
- integration callback posts a result to the DTO callbackUrl (nest, nest-integration-callback.vuln.ts)
- DTO url goes straight into HttpService get (nest, nest-link-preview.vuln.ts)
Wrongly reports (safe code) (9)
- host query checked against a Set of tenant hosts before interpolation (express, express-status-host.safe.js)
- host query must be in the avatar host allowlist and user is encoded (koa, koa-avatar-fetch.safe.js)
- export route maps a report key to a fixed path under the upstream base (koa, koa-export-callback.safe.ts)
- src hostname matched by an anchored regex on the CDN domain (koa, koa-image-proxy.safe.ts)
- unfurl url parsed and hostname checked against an allowlist (koa, koa-link-unfurl.safe.js)
- saved sync URL revalidated against the host allowlist before the request (koa, koa-saved-integration.safe.ts)
- endpoint hostname looked up in a Set of registered receivers (koa, koa-webhook-ping.safe.js)
- host query validated against a Set of service hosts before interpolation (nest, nest-status-host.safe.ts)
- host query checked against a Set of known hosts before interpolation (node, node-status-check.safe.js)
security/no-user-controlled-redirect
Section titled “security/no-user-controlled-redirect”Catches (31)
- redirect target read back from a client-set cookie, rewritten by rename-params (express, express-cookie-return-url-rename-params.vuln.ts)
- redirect target read back from a client-set cookie (express, express-cookie-return-url.vuln.ts)
- decoded to query value used as the redirect target (express, express-decode-to.vuln.ts)
- path query value appended directly after the app host (express, express-host-concat-path.vuln.js)
- res.location with the next query value then a 302 status (express, express-location-send-status.vuln.ts)
- login sends the user to the returnTo query value (express, express-login-return-to.vuln.js)
- logout redirects to the next query value with an explicit 302 (express, express-logout-next.vuln.js)
- OAuth callback redirects the code to the redirect_uri query value (express, express-oauth-redirect-uri.vuln.js)
- payment return_url query value used for a 303 redirect (express, express-payment-return-url.vuln.ts)
- preview link redirects to any host matching a regex that ends in pages.dev, rewritten by via-destructuring (express, express-preview-redirect-via-destructuring.vuln.js)
- preview link redirects to any host matching a regex that ends in pages.dev (express, express-preview-redirect.vuln.js)
- page param appended to a slash and used as redirect target (express, express-slash-concat-page.vuln.js)
- form handler redirects to the returnTo field with the status written after it (express, express-status-after-target.vuln.js)
- template literal wraps the returnTo query value in a redirect (express, express-template-return-to.vuln.js)
- worker sets the Location header of a new Response from the next query value (node, fetch-response-headers-location.vuln.ts)
- path query value appended directly after the app host (nest, nest-host-concat-path.vuln.ts)
- locale switch redirects with a status to the back query value (nest, nest-locale-switch-back.vuln.ts)
- Location header set from a client cookie value through res.location (nest, nest-location-header-cookie.vuln.ts)
- login callback redirects to the next query value through res (nest, nest-login-res-redirect.vuln.ts)
- OAuth authorize endpoint sends the code to the redirect_uri query value (nest, nest-oauth-callback-redirect-uri.vuln.ts)
- writeHead 302 to the return_to value read from the Cookie header (node, node-cookie-return-ts.vuln.ts)
- decoded to query value set as the Location header, rewritten by via-helper (node, node-decode-location-ts-via-helper.vuln.ts)
- decoded to query value set as the Location header (node, node-decode-location-ts.vuln.ts)
- path query value appended directly after the app host in Location (node, node-host-concat-path.vuln.js)
- OAuth step 302s the code to the redirect_uri query value (node, node-oauth-redirect-uri.vuln.js)
- setHeader Location from the returnTo query value (node, node-setheader-return-to.vuln.js)
- writeHead picks a Location holder only when a next value was sent (node, node-writehead-conditional-next.vuln.js)
- writeHead 302 with the next query value as Location, rewritten by rename-params (node, node-writehead-next-rename-params.vuln.js)
- writeHead 302 with the next query value as Location (node, node-writehead-next.vuln.js)
- login action redirects to the redirectTo query value, rewritten by callback (node, sveltekit-login-redirect-to-callback.vuln.ts)
- login action redirects to the redirectTo query value (node, sveltekit-login-redirect-to.vuln.ts)
Misses (9)
- continue page forwards a posted url field to the browser (koa, koa-continue-interstitial.vuln.js)
- path query value concatenated after the app host (koa, koa-host-concat-path.vuln.ts)
- locale switcher redirects back to the back query value (koa, koa-locale-back.vuln.js)
- login sends the user to the next query value (koa, koa-login-next.vuln.js)
- logout sets the Location header from the next query value (koa, koa-logout-set-location.vuln.js)
- OAuth callback redirects to a path stored in a client cookie (koa, koa-oauth-post-login-cookie.vuln.ts)
- payment provider return_url query value used for the final redirect (koa, koa-payment-return.vuln.ts)
- logout Redirect returns the returnTo query value as url (nest, nest-logout-redirect-url.vuln.ts)
- Redirect decorator returns the url from the query dto (nest, nest-redirect-decorator-dto.vuln.ts)
Wrongly reports (safe code) (7)
- decoded value must be a plain local path before redirect (express, express-decode-to.safe.ts)
- returnTo accepted only as a same-site relative path (express, express-login-return-to.safe.js)
- redirect_uri must exactly match one registered for the client (express, express-oauth-redirect-uri.safe.js)
- return_url validated by zod against an https host allowlist (express, express-payment-return-url.safe.ts)
- page param limited to a single slug segment (express, express-slash-concat-page.safe.js)
- returnTo checked by an anchored path regex before the redirect (express, express-template-return-to.safe.js)
- next accepted only as a same-site relative path (nest, nest-login-res-redirect.safe.ts)
security/require-path-containment
Section titled “security/require-path-containment”Catches (27)
- query name interpolated into the avatars dir path and read (express, express-avatar-read.vuln.js)
- backup path checked with startsWith on the dir without a trailing separator (express, express-backup-prefix.vuln.js)
- each posted name joined onto the uploads dir and unlinked in a forEach (express, express-batch-delete.vuln.js)
- basename refused as dot segments but not as empty, so a trailing slash removes the whole cache (express, express-cache-purge.vuln.ts)
- attachment id from the route joined onto the dir and unlinked, rewritten by rename-params (express, express-delete-attachment-rename-params.vuln.js)
- attachment id from the route joined onto the dir and unlinked (express, express-delete-attachment.vuln.js)
- doc page param joined onto the docs dir and read as text (express, express-doc-realpath.vuln.ts)
- export name from the route joined onto the exports dir and downloaded, rewritten by callback (express, express-export-download-callback.vuln.ts)
- export name from the route joined onto the exports dir and downloaded (express, express-export-download.vuln.ts)
- export name passed through two local helpers to readFile (express, express-export-two-helpers.vuln.ts)
- fs-extra remove on a body name joined onto the uploads dir (express, express-fsextra-remove.vuln.js)
- invoice name from the route joined onto the invoices dir (express, express-invoice-download.vuln.js)
- containment test only logs, the log file is read either way (express, express-log-inside-check.vuln.ts)
- query file concatenated onto the log dir and streamed to the response (express, express-log-tail.vuln.ts)
- report name from the route resolved under the reports root and downloaded (express, express-report-pdf.vuln.js)
- sendFile with the working directory, written as a template, as its root (express, express-sendfile-cwd-template-root.vuln.js)
- sendFile root read from an env var that may be unset, so the path is served as given (express, express-sendfile-env-root.vuln.js)
- template param joined with a named join import and sent as a file (express, express-template-preview.vuln.js)
- body theme name resolved into a css path under the themes dir (express, express-theme-zod.vuln.ts)
- body filename joined onto the store dir and written to disk (express, express-upload-save.vuln.js)
- avatar name from the search params passed to a method of the same class that reads it (node, node-class-avatar-store.vuln.ts)
- search param profile interpolated into the profiles dir path and read (node, node-config-load.vuln.ts)
- search param file joined onto the downloads dir and read (node, node-download-handler.vuln.js)
- relative check taken against the working directory, not the docs dir (node, node-relative-cwd.vuln.ts)
- url pathname concatenated into a pages file path and read (node, node-route-map.vuln.js)
- decoded url pathname joined onto the public dir and streamed (node, node-static-server.vuln.js)
- decoded url path resolved under the files root and read (node, node-uploads-list.vuln.ts)
Misses (15)
- route file param joined onto the assets dir and streamed (koa, koa-asset-send.vuln.js)
- query filename joined onto the attachments dir and unlinked (koa, koa-attachment-remove.vuln.ts)
- backup name from the route resolved under the backups dir and streamed (koa, koa-backup-download.vuln.ts)
- image id from the route joined onto the images dir and streamed (koa, koa-image-by-id.vuln.js)
- query name interpolated into the config dir path and read (koa, koa-query-config.vuln.js)
- query report name concatenated onto the reports base and read (koa, koa-report-csv.vuln.ts)
- posted file name joined onto the inbox dir and written (koa, koa-upload-name.vuln.js)
- Param id joined onto the attachments root and unlinked (nest, nest-attachment-delete.vuln.ts)
- Param file joined onto the files root and sent with sendFile (nest, nest-file-download.vuln.ts)
- Query file interpolated into the log root path and streamed (nest, nest-log-stream.vuln.ts)
- Query dto name joined onto the notes dir and read, dto only checks string (nest, nest-query-dto-read.vuln.ts)
- Param name joined into a template path under the templates dir (nest, nest-template-render.vuln.ts)
- Body filename joined onto the store dir and written (nest, nest-upload-store.vuln.ts)
- zip entry path joined onto the destination dir and written (zip slip) (nest, nest-zip-extract.vuln.ts)
- archive entry path joined onto the extract root and written (zip slip) (node, node-zip-slip.vuln.js)
Wrongly reports (safe code) (3)
- basename of the query name taken before building the path (express, express-avatar-read.safe.js)
- basename of the search param used when joining (node, node-download-handler.safe.js)
- basename of the decoded url path used when resolving (node, node-uploads-list.safe.ts)
security/require-sanitized-html
Section titled “security/require-sanitized-html”Catches (9)
- server-rendered React page injects bio via dangerouslySetInnerHTML (express, express-react-bio.vuln.tsx)
- React comment list sets __html from the request body (express, express-react-comment.vuln.jsx)
- React search page marks up the raw query through __html, rewritten by callback (express, express-react-search-callback.vuln.tsx)
- React search page marks up the raw query through __html (express, express-react-search.vuln.tsx)
- sanitized signature markup overwritten with the raw draft for preview (express, express-react-signature.vuln.tsx)
- jsdom node innerHTML set from the query string (koa, koa-jsdom-widget.vuln.js)
- server-rendered React card puts the headline in __html (koa, koa-react-card.vuln.jsx)
- jsdom insertAdjacentHTML inserts the request tag into the page (nest, nest-insert-adjacent.vuln.ts)
- node server renders React with the bio set through __html (node, node-react-profile.vuln.jsx)
Misses (23)
- cheerio template gets user bio via .html(bio) (express, express-cheerio-bio.vuln.js)
- comment preview echoes the posted comment body (express, express-comment-preview.vuln.ts)
- error page echoes the :page route param unescaped (express, express-error-page-param.vuln.ts)
- posted markdown rendered with marked and sent as HTML (express, express-markdown-render.vuln.js)
- profile page renders stored user bio as raw HTML (express, express-profile-bio.vuln.js)
- HTML report concatenates customer name into markup (express, express-report-email.vuln.ts)
- search page echoes the raw query into HTML (express, express-search-echo.vuln.js)
- error middleware echoes the requested path (koa, koa-error-handler.vuln.ts)
- markdown preview sends marked output unfiltered (koa, koa-markdown-preview.vuln.ts)
- profile route renders stored bio into the page (koa, koa-profile-page.vuln.js)
- search page sets ctx.body with the raw query (koa, koa-search-body.vuln.js)
- echo route sends the note as text/html (koa, koa-text-plain.vuln.ts)
- posted comment is wrapped in HTML and sent with res.send (nest, nest-comment-preview.vuln.ts)
- handler writes the failed id into an error page via res.send (nest, nest-error-res-send.vuln.ts)
- search endpoint returns an HTML string built from the query (nest, nest-json-search.vuln.ts)
- markdown body converted by marked and returned as HTML (nest, nest-markdown-render.vuln.ts)
- profile endpoint renders the stored bio into HTML (nest, nest-profile-bio.vuln.ts)
- controller returns a search page string with the raw query (nest, nest-search-header.vuln.ts)
- cheerio fills the comment slot with .html(comment) (node, node-cheerio-comment.vuln.js)
- error page streams the request path with res.write (node, node-error-write.vuln.ts)
- profile server interpolates the stored bio into HTML (node, node-profile-bio.vuln.js)
- report page concatenates the title query into HTML (node, node-report-concat.vuln.ts)
- http server ends the response with the query in HTML (node, node-search-end.vuln.js)
Wrongly reports (safe code) (0)
- none