Individual skill

database-security

Prevent SQL and NoSQL injection, unsafe ORM and raw-query use, over-privileged database identities, weak tenant isolation, and unauthenticated database transport. Use when generating SQL or raw query strings, NoSQL filters, ORM models or queries, database migration files, or connection strings.

dist/claude-skills/.claude/skills/database-security/SKILL.md

Read pinned source

Source commit eaba88102d91df65a9aa6397e8507c315c018f5e

What was checked

Matches the observed repository HEAD
Yes
Scanner rules are current
No
Repository scan complete
No
Skill scan complete
No
Observed behavior
Not checked yet
Last checked
Nov 6, 2026

These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.

Install this skill

Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.

An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.

Repository context

Repository stars (not skill ratings)
23
Repository last updated
Aug 14, 2026
License
MIT

Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.

Files and excerpt

File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.

Browse files
Read excerpt

<!-- Native skill bundle for Claude Code. Generated by `secure-vibe dev regenerate`. -->
<!-- Do not edit by hand; the source of truth is skills/database-security/SKILL.md. -->

# Database Security

Prevent SQL and NoSQL injection, unsafe ORM and raw-query use, over-privileged database identities, weak tenant isolation, and unauthenticated database transport. Use when generating SQL or raw query strings, NoSQL filters, ORM models or queries, database migration files, or connection strings.

## ALWAYS

- Bind every untrusted data value through the driver or ORM parameter API. Never place it into SQL with language-level interpolation or concatenation — `+`, f-strings, `%` formatting, `.format()`, JavaScript template interpolation. Driver placeholders (`%s`, `?`, `$1`, `:name`, `@name`) are the binding *mechanism*, not string formatting; confusing the two is how this rule is most often misread. The same applies to values read back out of the database and used to build a later query: stored input is still input, and second-order injection is this bug with a delay.
- Prefer the ORM's structured query-expression API over textual SQL. Where raw SQL is genuinely needed, use that framework's documented parameter-binding mechanism and never interpolate untrusted values into it. `references/orm-safe-query-examples.md` carries the verified form per framework.
- For SQL structure that cannot be a bind parameter — table and column identifiers, sort direction, sometimes the operator itself — map the external value to a fixed operator-controlled allowlist. Never copy an untrusted identifier or SQL fragment into the statement, escaped or not.
- Treat a NoSQL query as a structure, not a string. Build filters with the driver's typed query objects, and coerce every request-supplied value to its expected scalar type before it reaches a filter. A JSON body substituting `{"$ne": null}` where a string was expected turns an equality check into a match-all — operator injection needs no quote to break out of.
- Give each application its own database identity with the minimum grants it needs, and separate runtime privileges from migration privileges. The runtime identity must not receive schema-owner or DDL rights merely because migrations require them.