pablogore/ego-rs/security

Claude Code and agent skill by pablogore/ego-rs

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Trigger: security review, audit, SQL, query, user input, auth, JWT, permissions, tenant. Enforce security rules before writing or reviewing code that touches queries, auth, or external input.

Install

npx vskill@latest install pablogore/ego-rs/security

SKILL.md

The same SKILL.md was published earlier as pablogore/ego-rs/security.

Activation Contract

Load this skill when:

  • Writing or reviewing any code that constructs a database query
  • Writing or reviewing auth, JWT validation, or permission checks
  • Handling user-supplied input at any system boundary
  • Reviewing persistence, transport, or service-sdk crates

Hard Rules

Rule 1 — No SQL Injection (ABSOLUTE — no exceptions)

Never construct SQL by concatenating or interpolating user input, variables, or external data. This rule holds under ALL contexts: tests, migrations, admin tools, internal services, CLIs.

Forbidden patterns:

rust
// String format — NEVER
format!("SELECT * FROM users WHERE id = '{}'", user_id)
sqlx::query(&format!("SELECT ... WHERE name = '{}'", name))
// Manual concatenation — NEVER
"SELECT * FROM events WHERE aggregate_id = '".to_string() + id + "'"

Required pattern — always use bound parameters:

rust
// sqlx — always bind, never interpolate
sqlx::query("SELECT * FROM events WHERE aggregate_id = $1 AND tenant_id = $2")
.bind(aggregate_id)
.bind(tenant_id)
.fetch_all(&pool)
.await

If a query cannot be expressed with bound parameters (e.g., dynamic column names), it requires an explicit security review comment AND must use a strict allowlist — never a user-supplied string.

Identifier interpolation (e.g. `CREATE DATABASE`/`DROP DATABASE`, where Postgres cannot bind identifiers) falls under this same carve-out, not under the ABSOLUTE ban above, when — and only when — every interpolated value is provably internal:

rust
// Allowed: identifier is generated from an internal atomic counter, never external input.
// SECURITY: identifier is not user-controlled — see ego-rs-security Rule 1 carve-out.
let name = format!("ego_test_{n}"); // n: AtomicU64, process-local
conn.execute(format!("CREATE DATABASE {name}").as_str())

The security review comment above the call, and the allowlist being "generated by this process from a counter/fixed constant, never a request/config/env value," are both required at each call site. A value sourced from user input, request data, or external config never qualifies, no matter the comment.

Rule 2 — Tenant Isolation

Every query that touches tenant-scoped data MUST include tenant_id as a bound parameter. Never derive tenant from a mutable or user-controlled field without validation.

Rule 3 — JWT / Auth Boundaries
  • Never trust a JWT claim without signature verification first.
  • Scope checks (tenant, role) MUST happen after signature verification, not before or in parallel.
  • Do not log raw token values or private claims.
Rule 4 — No Privilege Escalation via Self-Referential Calls

Do not allow a service to issue requests on behalf of another tenant using its own credentials. Cross-tenant operations require an explicit CrossTenantPermit (see crates/service-sdk).

Decision Gates

SituationAction
Query uses user-supplied string in SQL textBlock — rewrite with bind()
Dynamic table/column name from user inputBlock — use allowlist only
Tenant field missing from queryBlock — add tenant scope
JWT claim used before verify()Block — verify first
Cross-tenant call without permitBlock — add CrossTenantPermit
All params bound, tenant scopedPass

Execution Steps

  1. Scan every sqlx::query / sqlx::query_as / sqlx::query_scalar call in the diff.
  2. Confirm no string interpolation or concatenation reaches the SQL text.
  3. Confirm every tenant-scoped table has tenant_id as a bound $N parameter.
  4. If auth code is touched: verify the signature-first ordering is intact.
  5. If cross-tenant code is touched: verify CrossTenantPermit is present and validated.
  6. Report findings as BLOCK (must fix before merge) or WARN (should fix, explain risk).

Output Contract

Return:

  • PASS — no violations found
  • BLOCK — list each violation with file:line, the forbidden pattern, and the required fix
  • WARN — list advisory issues with rationale

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1
7-day trend score
0

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/pablogore/ego-rs/security/badge)](https://verified-skill.com/skills/pablogore/ego-rs/security)

Something wrong with this skill or its page? Tell us.