# eslint-plugin-sequelize-security Guide for AI coding assistants using this plugin in a project. To change the plugin's own source, read https://github.com/ofri-peretz/eslint/blob/main/AGENTS.md instead. > ESLint Sequelize security rules — detects SQL injection in raw sequelize.query() and Sequelize.literal() calls built with string concatenation or template literals, connection configuration that disables TLS or certificate validation, and hardcoded database credentials. ## Enable it ```bash npm install --save-dev eslint-plugin-sequelize-security ``` Requires ESLint ^8.40.0 || ^9.0.0 || ^10.0.0 and Node >=22.13.0. Flat config files (`eslint.config.*`) are found by ESLint 8.57 and newer; on ESLint 9 and 10 they are the default. ```js // eslint.config.mjs import sequelizeSecurity from 'eslint-plugin-sequelize-security'; export default [sequelizeSecurity.configs.recommended]; ``` Each preset is one flat config object: put it in the array as an element, do not spread it. Rule ids are prefixed `sequelize-security/`. Add it to the config you already have; do not remove other plugins. TypeScript files need a TypeScript parser in the config (`typescript-eslint`). Use it alongside `eslint-plugin-security`, not instead of it: keep that plugin if the project has it. Measured overlap and the limits of both: https://eslint.interlace.tools/docs/getting-started/with-eslint-plugin-security ## Presets | Preset | Rules | Errors | Warnings | | ------------- | ----- | ------ | -------- | | `flagship` | 1 | 1 | 0 | | `recommended` | 1 | 1 | 0 | | `strict` | 4 | 4 | 0 | ### `flagship` Same rules as `recommended`. ### `recommended` 1 rule: - `no-unsafe-query` (error): Prevent SQL injection by disallowing string concatenation or interpolated template literals in raw Sequelize queries. ### `strict` Everything in `recommended` plus 3 more: - `no-hardcoded-credentials` (error): Disallow literal database passwords in Sequelize connection configuration, including credentials embedded in a connection URL. - `no-mass-assignment` (error): Disallow writing an inbound request object straight to the database through Sequelize, which lets the caller set every column the model exposes. - `require-tls` (error): Require TLS on Sequelize connections, so queries and credentials are not sent in cleartext and the server is authenticated. ## Other Interlace plugins by dependency If the project also depends on one of these, add the matching plugin the same way: - `express`, `fastify`, `koa`, `@hapi/hapi`, `restify`, `hono`, `next`, `@nestjs/core`, `@nestjs/common`, `aws-lambda`, `@types/aws-lambda`, `@middy/core`, `commander`, `yargs`, `@oclif/core`, `@modelcontextprotocol/*`: `eslint-plugin-node-security` - `express`: `eslint-plugin-express-security` - `@nestjs/common`, `@nestjs/core`: `eslint-plugin-nestjs-security` - `react`, `react-dom`, `preact`, `vue`, `svelte`, `@angular/core`, `solid-js`, `lit`, `next`, `nuxt`: `eslint-plugin-browser-security` - `jsonwebtoken`, `jose`, `express-jwt`, `@nestjs/jwt`, `jwks-rsa`, `jwt-decode`: `eslint-plugin-jwt-security` - `pg`, `pg-pool`, `pg-promise`, `postgres`, `slonik`: `eslint-plugin-postgresql-security` - `mysql2`, `mysql`: `eslint-plugin-mysql-security` - `mongodb`, `mongoose`: `eslint-plugin-mongodb-security` - `better-sqlite3`, `sqlite3`: `eslint-plugin-sqlite-security` - `knex`: `eslint-plugin-knex-security` - `@prisma/client`, `prisma`: `eslint-plugin-prisma-security` - `drizzle-orm`: `eslint-plugin-drizzle-security` - `typeorm`: `eslint-plugin-typeorm-security` - `@supabase/supabase-js`: `eslint-plugin-supabase-security` - `@modelcontextprotocol/*`: `eslint-plugin-mcp-sdk-security` - `openai`, `@openai/agents`: `eslint-plugin-openai-security` - `@anthropic-ai/sdk`, `@anthropic-ai/claude-agent-sdk`: `eslint-plugin-anthropic-security` - `@google/genai`: `eslint-plugin-gemini-security` - `ai`: `eslint-plugin-vercel-ai-security` - `aws-lambda`, `@types/aws-lambda`, `@middy/core`: `eslint-plugin-lambda-security` The full stack-to-plugin playbook (with config rendering and a proof step) is the `security-linting` skill: https://github.com/ofri-peretz/eslint/tree/main/skills/security-linting ## More - Docs: https://eslint.interlace.tools/docs/security/plugin-sequelize-security - README.md in this package: every rule with examples. - `eslint-plugin-sequelize-security/oxlint` is an entry point for oxlint's JS plugin support; see the README.