Interlace ESLint
ESLint Interlace
Browser Security

Overview

Browser security rules for XSS, CSRF, and client-side vulnerabilities

eslint-plugin-browser-security

npm version npm downloads License: MIT codecov

21 specialized rules — LLM-optimized error messages with CWE, OWASP, and CVSS metadata.

When to Use

This plugin is designed for client-side JavaScript/TypeScript applications running in web browsers:

EnvironmentExamples
Frontend FrameworksReact, Vue, Angular, Svelte, Solid
Build ToolsVite, Webpack, esbuild, Parcel
Full-Stack FrameworksNext.js (client), Nuxt (client), Remix (client)
Vanilla JSAny browser-based JavaScript

Target Vulnerabilities

CategoryThreats
XSS (Cross-Site Scripting)innerHTML, document.write, unsafe DOM manipulation
CSRF (Cross-Site Request Forgery)Missing tokens, insecure cookie handling
Insecure CommunicationpostMessage origin validation, WebSocket security
Data LeakagelocalStorage sensitive data, URL-based secrets

Not for server-side code — For Node.js/Express security, see express-security. For database security, see mongodb-security or pg.

Installation

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

Configuration

import browsersecurity from 'eslint-plugin-browser-security';

export default [browsersecurity.configs.recommended];

Available Presets

PresetDescription
recommendedBalanced security for most projects
strictMaximum enforcement (all rules as errors)

Rules

Browse all 21 rules with CWE and OWASP references:

Loading rules...

Initializing articles...

On this page