eslint-plugin-grpc-security
gRPC security — server reflection registered with no guard
AI-Optimized Security
Every rule includes CWE, OWASP, and CVSS metadata for AI assistants to provide precise, context-aware fixes.
Install
npm install -D eslint-plugin-grpc-securityimport { configs } from 'eslint-plugin-grpc-security';export default [configs.recommended];npm install -D oxlint-plugin-grpc-security{ "jsPlugins": ["oxlint-plugin-grpc-security"], "rules": { "grpc-security/no-unguarded-reflection": "error" }}import { defineConfig } from 'vite-plus';export default defineConfig({ lint: { jsPlugins: ['oxlint-plugin-grpc-security'], rules: { 'grpc-security/no-unguarded-reflection': 'error', }, },});oxlint-plugin-grpc-security re-exports eslint-plugin-grpc-security/oxlint: the same rules under the same IDs, and no ESLint install. Why oxlint.
Live from GitHub
This content is fetched directly from README.md on GitHub and cached for 1 hour.
Getting Started
- To check out the guide, visit eslint.interlace.tools. 📚
npm install --save-dev eslint eslint-plugin-grpc-security// eslint.config.mjs
import { configs } from 'eslint-plugin-grpc-security';
export default [configs.recommended];recommended is the preset to start with. The others are listed under Configuration Presets below.
Using oxlint or Vite+? Install oxlint-plugin-grpc-security: the same rules under the same grpc-security/<rule> IDs, without ESLint. Its page has the setup.
Description
Security rules for Node gRPC servers (server reflection registered with no guard).
They target servers built on @grpc/grpc-js.
Scope: every rule gates on the gRPC package it is about being imported, and on the binding a call resolves to. addToServer is an ordinary method name, so a rule that matched it alone would fire on code that has never seen gRPC.
The first rule is no-unguarded-reflection. Server reflection answers "which services does this listener serve?" to any client, unauthenticated. Registered unconditionally it ships to production, and grpcurl -plaintext host:port list then names every service on the server, the internal ones included. The rule reports a registration with no branch between it and the program running, and stays silent once any branch decides it (if (process.env.NODE_ENV !== 'production'), a config flag, an early return).
- Why — a linter nobody reads protects nothing. We would rather miss a finding than spend your attention on one that was never real.
- How — evidence, not names. A rule fires on what the code does, resolved through the AST and ESLint's own scope analysis.
- What — every finding carries its fix, in prose for a human and as structured JSON for an agent. Security rules add a CWE mapping and, where assigned, a CVSS score.
That trade costs recall, and we measure it: methodology · results · a false positive is a bug.
⚙️ Configuration Presets
| Preset | Description |
|---|---|
minimal | no-unguarded-reflection. |
recommended | no-unguarded-reflection. |
strict | Every rule. |
Usage
// eslint.config.js
import grpcSecurity from 'eslint-plugin-grpc-security';
export default [grpcSecurity.configs.recommended];Or wire the rules yourself:
import grpcSecurity from 'eslint-plugin-grpc-security';
export default [
{
plugins: { 'grpc-security': grpcSecurity },
rules: {
'grpc-security/no-unguarded-reflection': 'error',
},
},
];oxlint
Every rule in this plugin runs on oxlint as well as ESLint:
{ "jsPlugins": ["eslint-plugin-grpc-security/oxlint"] }📦 Compatibility
See the ESLint Version Support Policy for the full matrix.
Supported library versions
The library ranges the rules were written against. Documentation only: this package installs and requires none of them.
@grpc/reflection:^1.0.0grpc-server-reflection:^0.1.0
Rules
Legend
| Icon | Description |
|---|---|
| 💼 | 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. |
| Rule | CWE | OWASP | CVSS | Description | 🧠 | 💼 | ⚠️ | 🔧 | 💡 | 🚫 |
|---|---|---|---|---|---|---|---|---|---|---|
| no-unguarded-reflection | CWE-306 | A05:2021 | Register gRPC server reflection only behind a guard | 🟢 |
Support
Found a false positive? Open an issue: that is a bug. If the plugin helped, a star on ofri-peretz/eslint helps others find it.
🔗 Related ESLint Plugins
Part of the Interlace ESLint ecosystem — AI-native rules with LLM-optimized error messages:
Security
Code quality
| Plugin | Downloads | Description |
|---|---|---|
eslint-plugin-conventions | Team-specific habits and styles. | |
eslint-plugin-import-next | Fast cycle + import-graph analysis. | |
eslint-plugin-maintainability | Cognitive load and clean-code patterns. | |
eslint-plugin-modernization | ESNext migration + syntax evolution. | |
eslint-plugin-modularity | Structural integrity and DDD patterns. | |
eslint-plugin-operability | Production readiness and resource health. | |
eslint-plugin-react-a11y | React accessibility / WCAG. | |
eslint-plugin-react-features | React best practices and optimization. | |
eslint-plugin-reliability | Runtime stability and error safety. |
📄 License
MIT © Ofri Peretz
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.