HomeReadTools deskeslint-plugin-nestjs-security Finds 6 Vulnerability Classes in 40K-Line Codebase
Tools·Jun 16, 2026

eslint-plugin-nestjs-security Finds 6 Vulnerability Classes in 40K-Line Codebase

This review examines eslint-plugin-nestjs-security's ability to detect common NestJS security flaws, analyzing its reported findings on a production codebase and its approach to identifying missing…

This review examines eslint-plugin-nestjs-security's ability to detect common NestJS security flaws, analyzing its reported findings on a production codebase and its approach to identifying missing security controls.

The Answer Up Front

Developers working with NestJS, especially those inheriting existing codebases or operating under tight deadlines, should integrate eslint-plugin-nestjs-security into their CI pipeline immediately. It excels at catching common, subtle security oversights that human code reviewers often miss, particularly those stemming from the absence of decorators, pipes, or guards. Skip it only if your NestJS application is trivial or if you already employ a robust, custom-built static analysis suite specifically tailored for NestJS security. The bottom line is that this plugin offers a high-value, low-overhead layer of defense against common NestJS vulnerabilities.

Methodology

This v0 review draws on the founder's published claims at https://dev.to/ofri-peretz/i-inherited-a-nestjs-codebase-the-first-lint-run-found-6-vulnerabilities-55ma, accessed on 2026-05-28. Independent benchmarks are pending. Update cadence: re-tested when claims diverge from observed behavior.

The review covers eslint-plugin-nestjs-security, version current as of 2026-05-28, as described by author Ofri Peretz. The source details the plugin's initial run on a 40K-line production NestJS codebase, reporting a 12-second execution time and 47 violations across 6 distinct vulnerability classes. Peretz provides specific code examples for each class, illustrating both the vulnerable pattern and the plugin's proposed fix, alongside an explanation of why human code review failed.

What is not covered includes independent performance benchmarks, long-term workflow integration, false positive rates, or comprehensive coverage of all rules. Our assessment is based solely on the specific examples and claims presented.

What It Does

eslint-plugin-nestjs-security is an ESLint plugin designed to identify common security vulnerabilities and misconfigurations specific to NestJS applications. Its core strength lies in detecting the absence of critical security controls, a class of bug often overlooked in human code reviews. The plugin operates via structural analysis, requiring no complex type inference to function, making it efficient.

Missing Access Controls

The plugin includes a require-guards rule that flags any @Controller class or route handler lacking an @UseGuards(...) decorator or an explicit @Public() opt-out. The author describes a scenario where a global JwtAuthGuard was bypassed due to a refactor and mocked tests, a flaw missed by conventional means. This rule specifically targets CWE-284 (Improper Access Control) and helps prevent accidental exposure of sensitive endpoints.

Input Validation and Sanitization

Critical rules target missing validation pipes and unsanitized input. The plugin identifies handlers that process request data (e.g., @Body(), @Query(), @Param()) without an associated ValidationPipe, preventing issues like mass assignment. It also checks for direct use of unsanitized input, crucial for mitigating injection attacks (e.g., XSS, SQL injection) when data is later rendered or used in database queries. Explicit sanitization pipes or DTO transformations are encouraged.

Configuration and Token Security

The plugin addresses common configuration pitfalls and token security. It helps identify exposed internal routes, often administrative, that might lack proper authentication. It also flags insecure CORS settings, such as allowOrigin: '*', which can expose an application to unauthorized cross-origin requests. Furthermore, rules ensure that CSRF tokens are properly implemented and validated for state-changing operations, preventing Cross-Site Request Forgery attacks.

What's Interesting / What's Not

The most compelling aspect of eslint-plugin-nestjs-security is its explicit focus on "checking for what's missing," as the author articulates. This asymmetry in detection is a powerful argument for its utility: human reviewers excel at validating what is present, while static analysis can reliably flag what is not. The detailed examples, particularly the JwtAuthGuard failure due to a refactor and mocked tests, underscore how easily critical security controls can be bypassed and remain undetected through conventional means. The plugin's ability to catch these subtle yet severe issues with a reported 12-second scan time on a 40K-line codebase is a significant efficiency gain. The direct mapping of findings to specific CWEs adds professional rigor, aiding security teams in categorization.

What's less clear from this initial signal is the plugin's false positive rate. While the article highlights successful detections, the absence of discussion around potential over-flagging or necessary configuration to fine-tune rules leaves an open question. Similarly, the article does not delve into the ongoing maintenance burden or how it handles custom decorators or guards. The lack of independent verification of the reported scan time and violation count means these remain founder claims.

Pricing

eslint-plugin-nestjs-security is an open-source ESLint plugin, available for free. Pricing snapshot date: 2026-05-28.

Verdict

For any team developing with NestJS, eslint-plugin-nestjs-security is a clear recommendation. Its targeted approach to identifying missing security controls, a blind spot for human code review and even some testing methodologies, makes it an essential layer in a defense-in-depth strategy. The specific, detailed examples provided by the author demonstrate its practical value in catching critical vulnerabilities like unguarded controllers and missing validation pipes. While independent benchmarks are still needed to verify performance claims, the reported 12-second scan time for a substantial codebase suggests a low-friction integration. This tool is a pragmatic choice for improving the security posture of NestJS applications.

What We'd Test Next

Our next steps would involve an independent benchmark of eslint-plugin-nestjs-security on a diverse set of NestJS codebases, varying in size and complexity, to verify the reported scan times and violation counts. We would specifically focus on the false positive rate for each rule and explore the configuration options available to mitigate them. Testing its integration into a typical CI/CD pipeline, including pre-commit hooks and pull request checks, would assess its practical deployment friction. We would also investigate its extensibility for custom security rules or its ability to handle non-standard NestJS patterns, which often arise in mature codebases.

The investor read

The emergence of highly specialized static analysis tools like eslint-plugin-nestjs-security signals a maturing market for developer-first security. General-purpose SAST solutions often have high false positive rates or lack deep framework-specific context. This plugin exemplifies a trend towards "hyper-specific SAST" that leverages framework conventions to detect subtle, critical security omissions. This niche focus reduces noise and increases developer trust. Comparable tools exist for other frameworks, indicating a viable market for focused, open-source security linting. For investors, this project is likely a deliberate small or bootstrapped play. An investable path would involve expanding to a broader suite of framework-specific security linters, potentially offering commercial support or integrating into a larger developer security platform.

Sources · how we verified
  1. I Inherited a NestJS Codebase. The First Lint Run Found 6 Vulnerabilities.

Every claim ties to a primary source. See our methodology.

Reported by the Riley desk on Founderr Pulse’s Tools beat. Every factual claim is tied to a primary source and linked; anything that can’t be stood up doesn’t run. Founderr (RIKHATH LLC) is the accountable publisher and corrects in place. How we work · About · File a correction.
R
Riley

The Riley desk covers tools — what founders are building with, switching to, and abandoning. Every claim is sourced and linked. Operated by Founderr (RIKHATH LLC) See the desk →

Founderr Pulse — free & independent. The desk for people who build & back.