awesome-nodejs-security

Security resources

A curated collection of security resources and tools for Node.js applications

Awesome Node.js Security resources

GitHub

3k stars
68 watching
242 forks
last commit: almost 2 years ago
Linked from 2 awesome lists

cybersecurityhacktoberfestinfosecnodejsowasppentestsecurityvulnerabilitiesweb-security

Tools / Web Framework Hardening

HelmetHelmet helps you secure your Express apps by setting various HTTP headers
koa-helmetkoa-helmet helps you secure your Koa apps by setting various HTTP headers
blankie52over 3 years agoCSP plugin for
fastify-helmet411almost 2 years agofastify-helmet helps you secure your apps by setting important security headers
nuxt-security836almost 2 years ago🛡 Security Module for Nuxt based on OWASP Top 10 and Helmet
reporting-api3almost 2 years agoSetup and collect CSP, Reporting API v0 and v1 reports to reliabily parse them to be processed by the user

Tools / GitHub Actions and CI/CD Security

New dependencies advisorGitHub Action adding comments to pull requests with package health information about newly added npm dependencies
OpenSSF Scorecard MonitorSimplify OpenSSF Scorecard tracking in your organization with automated markdown and JSON reports, plus optional GitHub issue alerts

Tools / Static Code Analysis

eslint-plugin-securityESLint rules for Node Security. This project will help identify potential security hotspots, but finds a lot of false positives which need triage by a human
tslint-plugin-securityTSLint rules for Node Security. This project will help identify potential security hotspots, but finds a lot of false positives which need triage by a human
safe-regexdetect potentially catastrophic exponential-time regular expressions by limiting the star height to 1
vuln-regex-detectorThis module lets you check a regex for vulnerability. In JavaScript, regular expressions (regexes) can be "vulnerable": susceptible to catastrophic backtracking. If your application is used on the client side, this can be a performance issue. On the server side, this can expose you to Regular Expression Denial of Service (REDOS)
git-secrets12,504over 2 years agoPrevents you from committing secrets and credentials into git repositories
DevSkim920almost 2 years agoDevSkim is a set of IDE plugins and rules that provide security "linting" capabilities. Also has support for CLI so it can be integrated into CI/CD pipeline
ban-sensitive-files64almost 2 years agoChecks filenames to be committed against a library of filename rules to prevent storing sensitive files in Git. Checks some files for sensitive contents (for example authToken inside .npmrc file)
NodeJSScan2,405almost 2 years agoA static security code scanner for Node.js applications. Including neat UI that can point where the issue is and how to fix it
NodeSecure CLI367almost 2 years agoNode.js CLI that allow you to deeply analyze the dependency tree of a given npm package or a directory
Trust But Verify59over 4 years agoTBV compares an npm package with its source repository to ensure the resulting artifact is the same
lockfile-lint788about 2 years agolint lockfiles for improved security and trust policies to keep clean from malicious package injection and other insecure configurations
pkgsign94about 7 years agoA CLI tool for signing and verifying npm and yarn packages
semgrepOpen-source, offline, easy-to-customize static analysis for many languages. Some others on this list (NodeJSScan) use semgrep as their engine
npm-scan50about 5 years agoAn extensible, heuristic-based vulnerability scanning tool for installed npm packages
js-x-ray229almost 2 years agoJavaScript and Node.js SAST scanner capable of detecting various well-known malicious code patterns (Unsafe import, Unsafe stmt, Unsafe RegEx, encoded literals, minified and obfuscated codes)
cspscannerCSP Scanner helps developers and security experts to easily inspect and evaluate a site’s Content Security (CSP)
eslint-plugin-anti-trojan-source76over 3 years agoESLint plugin to detect and prevent Trojan Source attacks from entering your codebase
sdc-check140almost 3 years agoSmall tool to inform you about potential risks in your project dependencies list
fix-lockfile-integrity6almost 2 years agoA CLI tool to fix weak integrity hash (sha1) to a more secure integrity hash (sha512) in your npm lockfile
Bearer2,112almost 2 years agoA CLI tool to find and help you fix security and privacy risks in your code according to OWASP Top 10
GuardDog635almost 2 years agoGuardDog is a CLI tool to Identify malicious PyPI and npm packages

Tools / Dynamic Application Security Testing

PurpleTeamA security regression testing SaaS and CLI, perfect for inserting into your build pipelines. You don’t need to write any tests yourself. purpleteam is smart enough to know how to test, you just need to provide a Job file which tells purpleteam what you want tested

Tools / Input Validation & Output Encoding

node-esapinode-esapi is a minimal port of the ESAPI4JS (Enterprise Security API for JavaScript) encoder
escape-htmlEscape string for use in HTML
js-string-escapeEscape any string to be a valid JavaScript string literal between double quotes or single quotes
validator23,192almost 2 years agoAn npm library of string validators and sanitizers
xss-filtersJust sufficient output filtering to prevent XSS!
DOMPurify14,245almost 2 years agoa DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG
envalid1,399almost 2 years agoEnvalid is a small library for validating and accessing environment variables in Node.js
data-guardiandata-guardian is a tiny, highly customizable lib which can mask sensitive data in arbitrary entities and can help with

Tools / Secure Composition

pug-plugin-trusted-typesPug template plugin makes it easy to securely compose HTML from untrusted inputs and provides CSP & CSRF
safesqlA tagged template ( ) that understands 's & 's query grammar to prevent
sh-template-tagA tagged template ( ) that understands Bash syntax so prevents

Tools / CSRF

csurfNode.js CSRF protection middleware
crumb171almost 2 years agoCSRF crumb generation and validation for
fastify-csrf154almost 2 years agoA plugin for adding CSRF protection to

Tools / Vulnerabilities and Security Advisories

npq958about 2 years agoSafely install packages with npm or yarn by auditing them as part of your install process
snykSnyk helps you find, fix and monitor known vulnerabilities in Node.js npm, Ruby and Java dependencies, both on an ad hoc basis and as part of your CI (Build) system
node-release-linesIntrospection API for Node.js release metadata. Provides information about release lines, their relative status along with details of each release
auditjs223almost 2 years agoAudits an NPM package.json file to identify known vulnerabilities using the
npm-auditRuns a security audit based on your package.json using npm
npm-audit-resolverManage npm-audit results, including options to ignore specific issues in clear and auditable way
gammaray104over 6 years agoRuns a security audit based on your package.json using the
patch-packageAllows app authors to create fixes for npm dependencies (in node_modules) without forking or waiting for merged PRs, by creating and applying patches
check-my-headers45over 3 years agoFast and simple way to check any HTTP Headers
is-website-vulnerable1,942about 2 years agofinds publicly known security vulnerabilities in a website's frontend JavaScript libraries
joi-security44over 2 years agoDetect security flaws in Joi validation schemas
confused704about 2 years agoTool to check for dependency confusion vulnerabilities in multiple package management systems. See for reference on the reasoning for this tool
nodejs-cve-checker6over 2 years agoA simple tool that validates CVEs were published to NVD after a Node.js Security Release

Tools / Security Hardening

hijagger288almost 2 years agoChecks all maintainers of all npm and PyPI packages for hijackable packages through domain re-registration
snync43about 4 years agoMitigate security concerns of Dependency Confusion supply chain security risks
NopPP - No Prototype Pollution27almost 4 years agoTiny helper to protect against Prototype Pollution vulnerabilities in your application regardless if they introduced in your own code or in 3rd-party code
anti-trojan-source47over 3 years agoDetect trojan source attacks that employ unicode bidi attacks to inject malicious code
express-limiterRate limiting middleware for Express applications built on redis
limitsSimple express/connect middleware to set limit to upload size, set request timeout etc
rate-limiter-flexibleFast, flexible and friendly rate limiter by key and protection from DDoS and brute force attacks in process Memory, Cluster, Redis, MongoDb, MySQL, PostgreSQL at any scale. Express and Koa examples included
tor-detect-middleware14almost 3 years agoTor detect middleware for express
express-enforces-ssl194almost 6 years agoEnforces SSL for Express based Node.js projects. It is however highly advised that you handle SSL and global HTTP rules in a front proxy
bourne172almost 2 years agodrop-in replacement with prototype poisoning protection
fastify-rate-limit508almost 2 years agoA low overhead rate limiter for your routes
secure-json-parse227almost 2 years agodrop-in replacement with prototype poisoning protection
express-brute564over 5 years agoA brute-force protection middleware for express routes that rate-limits incoming requests, increasing the delay with each request in a fibonacci-like sequence
allowed-scripts12about 2 years agoExecute allowed lifecycle scripts
ses845almost 2 years agoA shim for Hardened JavaScript, a language mode that mitigates prototype pollution attacks and supports safely confining multiple tenants in a single JavaScript realm, endowing each other with hardened API objects
lavamoat881almost 2 years agoMitigates supply chain attacks using to confine third-party dependencies and limit their access to host powers based on policies generated by trust-on-first-use static analysis
moddableImplements Hardened JavaScript as the security model for embedded systems
is-my-node-vulnerable210almost 2 years agopackage that checks if your Node.js installation is vulnerable to known security vulnerabilities

Data Sources

resourceA structured list of all the Node.js versions, the binary builds, the dependencies they include (npm, zlib, openssl) along with their versions, whether the release is a security release and whether it is an LTS
resource504almost 2 years agoThe GitHub repository maintains a directory with all the CVEs applied to Node.js runtime versions

Security Incidents / Protestware supply chain security issues

PyPI package author of atomicwrites deletes his own code
left-pad
node-ipc, Mariusz Nowak and their , Evan Jacobs and their , , , - all with regards to the Russian-Ukraine crisis
Open Souce Peace78about 4 years agoThe organization maintains a list of identified protestware incidents
2022's Techcrunch protestware review
2022's Snyk protestware types

Security Incidents / npm and JavaScript specific security incidents and supply chain security issues

Socket
Socket
sonatype
Snyk
Phylum
https://www.landh.tech/blog/20241028-hidden-supply-chain-links/
Sonatype
Snyk
stacklok
Adventures in Nodeland
Sonatype
landh.tech
Bleeping Computer
Sonatype
Socket
Sonatype
SC Media
Sonatype, Tweets
Checkmarx
Darcy Clarke's blog
Phylum
bignum npm packageSupply Chain Attack Exploits Abandoned S3 Buckets to Distribute Malicious Binaries for
The Hacker News,
Vulcan
Illustria on The Hacker News
The Hacker News
phylum
JFrog
Louisw Lang on Twitter
Aqua
TheHackerNews
Mend
darkreading
GitHub
Snyk,
TheRegister
Aqua
Aqua,
Checkmarx Security blog
Snyk advisory for event-source-pollyfill, ,
Snyk blog, ,
Checkmarx Security blog
TheHackerNews
TheRecord
TheRecord
Sonatype
Bleepingcomputer, , ,
the register
Cybersecurity and Infrastructure Security Agency (CISA), , , ,
arstechnica.com
Twitter
Bleepingcomputer
zdnet.com,
sonatype,
zdnet
zdnet
Forbes Lindesay - Maintainer post-mortem,
Snyk, ,
npm, ,
github issue2,185almost 8 years ago, , , , , ,
github issue125about 2 years ago, , , ,
GitHub issue41,159almost 2 years ago, , , ,
conventional-changelog repository update7,902almost 2 years ago
CJ blog on typosquat packages, , , ,
left-pad.io, ,
BadJSA resource for malicious incidents is - a repository of malicious JavaScript that has been found in websites, extensions, npm packages, and anywhere else JavaScript lives
npm zoo20almost 4 years agois an archive keeping track of the original malicious packages source code for educational purposes

Educational / Newsletters

Node.js Security newsletterJavaScript & web security insights, latest security vulnerabilities, hands-on secure code insights, npm ecosystem incidents, Node.js runtime feature updates, Bun and Deno runtime updates, secure coding best practices, malware, malicious packages, and more

Educational / Articles

A Roadmap for Node.js Security(original domain not available. See )
10 npm security best practices
OWASP Cheat Sheet Series - Node.js Security Cheat Sheet
What is a backdoor? Let’s build one with Node.js
The Anatomy of a Malicious Package
Why npm lockfiles can be a security blindspot for injecting malicious modules
GitHub Actions to securely publish npm packages
Top 11 Node.js security best practices | Sqreen.com
A Tale of (prototype) Poisoning
Securizing your GitHub org
Research Case Study: Supply Chain Security at Scale – Insights into NPM Account Takeovers

Educational / Research Papers

Deep dive into Visual Studio Code extension security vulnerabilities

Educational / Books

Secure Your Node.js Web Application: Keep Attackers Out and Users Happyby Karl Duuna, 2016
Essential Node.js Securityby Liran Tal, 2017 - Hands-on and abundant with source code for a practical guide to Securing Node.js web applications
Securing Node JS Appsby Ben Edmunds, 2016 - Learn the security basics that a senior developer usually acquires over years of experience, all condensed down into one quick and easy handbook
Web Developer Security ToolboxBundled Node.js and Web Security Books
Thomas Gentilhommebook:
Node.js Secure Coding: Defending Against Command Injection Vulnerabilities
Node.js Secure Coding: Prevention and Exploitation of Path Traversal Vulnerabilities
Node.js Secure Coding: Mitigate and Weaponize Code Injection Vulnerabilities

Educational / Roadmaps

Node.js Developer Roadmap

Companies

SnykA developer-first solution that automates finding & fixing vulnerabilities in your dependencies
SqreenAutomated security for your web apps - real time application security protection
NodeSourceMission-critical Node.js applications. Provides N|Solid and Node Certified Modules
GuardRailsA GitHub App that gives you instant security feedback in your Pull Requests
NodeSecureAn organization of developers building free and open source JavaScript/Node.js security tools

Companies / Hacking Playground

OWASP NodeGoat1,895over 2 years agoThe OWASP NodeGoat project provides an environment to learn how OWASP Top 10 security risks apply to web applications developed using Node.js and how to effectively address them
OWASP Juice Shop10,585almost 2 years agoThe OWASP Juice Shop is an intentionally insecure webapp for security trainings written entirely in Javascript which encompasses the entire OWASP Top Ten and other severe security flaws
DomGoatClient XSS happens when untrusted data from sources ends up in sinks. Information and excercises on different sources, different sinks and example of XSS occuring due to them in the menu on the left-hand side

Backlinks from these awesome lists:

More related projects: