Skip to main content
interlace
Plugin: node-security

Overview

Node.js security rules for fs, child_process, vm, and crypto modules

Live from GitHub

This content is fetched directly from README.md on GitHub and cached for 1 hour.

AI-Optimized Security

Every rule includes CWE, OWASP, and CVSS metadata for AI assistants to provide precise, context-aware fixes.


Live README from GitHubfrom eslint-plugin-node-security/README.md, cached for 1 hour.Edit on GitHub
Interlace

  

Node.js

  

oxlint

  

ESLint

Security-focused ESLint plugin for Node.js built-in modules (fs, child_process, vm, crypto, Buffer).

NPM VersionNPM DownloadsPackage LicenseCodecovSince Dec 2025

⭐ If this plugin caught a real bug for you, star the repo — it's the signal that keeps these rules maintained.

Description

This plugin provides Security rules for Node.js core modules (fs, child_process, crypto, etc).

Philosophy

Interlace fosters strength through integration. Instead of stacking isolated rules, we interlace security directly into your workflow to create a resilient fabric of code. We believe tools should guide rather than gatekeep, providing educational feedback that strengthens the developer with every interaction.

Getting Started

npm install eslint-plugin-node-security --save-dev

⚙️ Configuration Presets

PresetDescription
recommendedBalanced security for most Node.js projects
strictMaximum security enforcement (all rules as errors)
fs-securityFocus on file system vulnerabilities (CWE-22, CWE-73)
cryptoCryptographic security rules only

💡 What You Get

  • 31 security rules covering Node.js core module vulnerabilities
  • Command Injection Detection for child_process.exec, spawn, and execFile
  • Path Traversal Prevention for fs module operations
  • TOCTOU Race Condition Detection for file system operations
  • Cryptographic Security for weak algorithms and key management
  • LLM-optimized messages with CWE references and fix guidance

📦 Compatibility

PackageVersion
ESLint^8.0.0 || ^9.0.0 || ^10.0.0
Node.js>=18.0.0

See the ESLint Version Support Policy — current ecosystem share data, the 20% gate, and the forward-looking exception that covers v10.

Rules

Legend

IconDescription
💼Recommended: Included in the recommended preset.
⚠️Warns: Set to warn in recommended preset.
🔧Auto-fixable: Automatically fixable by the --fix CLI option.
💡Suggestions: Providing code suggestions in IDE.
🚫Deprecated: This rule is deprecated.
🟢Type-unaware: AST-only, runs in oxlint JS-plugin tier.
🟡Type-aware (refining): pure-AST primary path; types refine precision.
🟠Type-aware (graceful): requires TS program; silent without it.
RuleCWEOWASPCVSSDescription🧠💼⚠️🔧💡🚫
detect-child-processCWE-78Detects instances of childprocess & non-literal exec() calls that may allow command injection🟢
detect-eval-with-expressionCWE-95A03:2021Detects eval(variable) which can allow an attacker to run arbitrary code inside your process🟢
detect-non-literal-fs-filenameCWE-22Detects variable in filename argument of fs calls, which might allow an attacker to access anything on your…🟢
detect-suspicious-dependenciesCWE-506This rule detects package imports that look like typosquatting attempts on popular npm packages🟢
lock-fileCWE-829CWE: CWE-829🟢
no-arbitrary-file-accessCWE-22A01:2021Prevents file system access with unsanitized user input to protect against path traversal attacks.🟢
no-buffer-overreadCWE-126Detects buffer access beyond bounds🟢
no-cryptojsCWE-1104A06:2021Disallow deprecated crypto-js library (use native crypto instead)🟢
no-cryptojs-weak-randomCWE-338A02:2021Disallow crypto-js WordArray.random() (CVE-2020-36732)🟢
no-data-in-temp-storageCWE-312Temporary directories (/tmp, /var/tmp, temp/) are often world-readable or persist longer than expected🟢
no-deprecated-bufferCWE-676Disallow the deprecated new Buffer() constructor and Buffer() factory call.🟢💡
no-deprecated-cipher-methodCWE-327A02:2021Disallow deprecated crypto.createCipher/createDecipher methods🟢
no-dynamic-command-stringCWE-77A03:2021Detects dynamically assembled command strings handed to a shell flag (bash -c) or to a command-runner that…🟢
no-dynamic-dependency-loadingCWE-1104This rule detects dynamically constructed paths in require() and import() statements🟢
no-dynamic-requireForbid require() calls with non-literal arguments🟢
no-ecb-modeCWE-327A02:2021Disallow ECB encryption mode (use GCM or CBC instead)🟢
no-insecure-key-derivationCWE-916A02:2021Disallow PBKDF2 with insufficient iterations (< 100,000)🟢
no-insecure-rsa-paddingCWE-327A02:2021Disallow RSA PKCS#1 v1.5 padding (CVE-2023-46809 Marvin Attack)🟢
no-math-random-cryptoCWE-338A02:2021Disallow Math.random() for cryptographic purposes (tokens, keys, secrets, salts, IVs)🟢
no-self-signed-certsCWE-295A07:2021Disallow rejectUnauthorized false in TLS options🟢
no-sha1-hashCWE-327A02:2021Disallow sha1() from crypto-hash package (use sha256 or sha512)🟢
no-ssrfCWE-918A10:2021Detect HTTP requests with user-controlled URLs (server-side request forgery).🟢💡
no-static-ivCWE-329A02:2021Disallow static or hardcoded initialization vectors (IVs)🟢
no-timing-unsafe-compareCWE-208A02:2021Disallow timing-unsafe comparison of secrets🟢
no-toctou-vulnerabilityCWE-367A01:2021Detects Time-of-Check-Time-of-Use (TOCTOU) race condition vulnerabilities in file system operations.🟢
no-unsafe-buffer-allocCWE-908A01:2021Disallow Buffer.allocUnsafe() and Buffer.allocUnsafeSlow(), which return uninitialized memory.🟢💡
no-unsafe-dynamic-requireCWE-494Disallows dynamic require() calls with non-literal arguments that could lead to security vulnerabilities🟢
no-weak-cipher-algorithmCWE-327A02:2021Disallow weak cipher algorithms (DES, 3DES, RC4, Blowfish, RC2, IDEA)🟢
no-weak-hash-algorithmCWE-327A02:2021Disallow weak hash algorithms (MD5, MD4, SHA-1, RIPEMD)🟢
no-zip-slipCWE-22Detects zip slip/archive extraction vulnerabilities🟢
prefer-native-cryptoCWE-1104A06:2021Prefer native crypto over third-party libraries🟢
require-dependency-integrityCWE-494CWE: CWE-494🟢
require-secure-credential-storageCWE-312This rule detects when credentials are stored using localStorage.setItem() or fs.writeFile() without encryp…🟢
require-secure-deletionCWE-459CWE: CWE-459🟢
require-storage-encryptionCWE-312CWE: CWE-312🟢

Part of the Interlace ESLint Ecosystem — AI-native security plugins with LLM-optimized error messages:

PluginDownloadsDescription
eslint-plugin-secure-codingdownloadsGeneral security rules & OWASP guidelines.
eslint-plugin-pgdownloadsPostgreSQL security & best practices.
eslint-plugin-node-securitydownloadsNode.js core-module security (fs, child_process, vm, crypto, Buffer).
eslint-plugin-jwtdownloadsJWT security & best practices.
eslint-plugin-browser-securitydownloadsBrowser-specific security & XSS prevention.
eslint-plugin-express-securitydownloadsExpress.js security hardening rules.
eslint-plugin-lambda-securitydownloadsAWS Lambda security best practices.
eslint-plugin-nestjs-securitydownloadsNestJS security rules & patterns.
eslint-plugin-mongodb-securitydownloadsMongoDB security best practices.
eslint-plugin-vercel-ai-securitydownloadsVercel AI SDK security hardening.
eslint-plugin-import-nextdownloadsNext-gen import sorting & architecture.

⭐ Support & follow

If this plugin caught a real bug for you, star the repo — stars are the signal that keeps the Interlace ESLint ecosystem maintained — and follow the writeups on Dev.to for the benchmarks and security research behind these rules.

GitHub stars

📄 License

MIT © Ofri Peretz

ESLint Interlace Plugin

Interlace

View README.md on GitHub →

Building secure JavaScript with Interlace? Star the repo to get new rules and CWE coverage as we ship them — or follow the AI-code-security benchmarks behind them.

On this page

No Headings