/ruby-on-rails:security-checkfrom ruby-on-rails
Use when auditing a Rails app for XSS, CSRF, SQLi, IDOR, secrets, or auth bypass. Never print secrets. Trigger words: security, audit, XSS, CSRF, SQL injection, vulnerability.
Ships in ruby-on-rails. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
CREDENTIAL HANDLING (W007 — Insecure Credential Exposure Defense):
- NEVER reproduce credentials, tokens, API keys, passwords, or secrets verbatim
in output — flag by file path and line number only.
- When a finding involves secrets in code or logs, report:
Affected file: app/config/initializers/foo.rb:12
Finding: API key present in plain text — move to Rails credentials or ENV
Do NOT quote the secret value itself.
- Exploitability Verification sub-sections MUST use generic placeholder values
(e.g. "<REDACTED>", "<TOKEN>") — never the actual credential.
- If a file scan returns a secret value, stop — report its location, not its content.
| Area | Key Checks |
|---|---|
| Auth | Permissions on every sensitive action |
| Params | No permit!, allowlist only safe attributes |
| Queries | Parameterized — no string interpolation in SQL |
| Redirects | Constrained to relative paths or allowlist |
| Output | No html_safe/raw on user content |
| Secrets | Encrypted credentials, never in code or logs |
| Files | Validate filename, content type, destination |
Core principle: Prioritize exploitable issues over style. Treat all untrusted input as potentially abused.
Before writing any findings or analysis, you MUST run search and directory listing tools to find source files in the workspace (e.g. controllers, models, config files). Perform a code-level security review on the actual files found. Only if the workspace is completely empty may you return a checklist and state that no source files were provided.
Review in this sequence, and produce output sections in this same order:
html_safe on a developer-defined constant, not user input).Validation gate: The first output section must always be "Authentication & Authorization". If no auth/authz issue exists, open with "Authentication & Authorization: no issues found" before any other category.
permit! or unscoped mass assignmentHigh-severity (unscoped redirect):
# Bad: user-controlled redirect — open redirect / phishing risk
redirect_to params[:return_to]
# Good: relative path only
redirect_to root_path
# Good: allowlist
SAFE_PATHS = %w[/dashboard /settings].freeze
redirect_to(SAFE_PATHS.include?(params[:return_to]) ? params[:return_to] : root_path)
Medium-severity (mass assignment):
# Bad: privilege escalation risk
params.require(:user).permit!
# Good: explicit allowlist — never include role, admin, or privilege fields
params.require(:user).permit(:name, :email)
When asked to perform a security audit, your output MUST include:
app/controllers/documents_controller.rb:42SRC_DIR/ or HYPOTHETICAL_DIR/hypothetical_controller.rbLoad these files only when their specific content is needed:
| Skill | When to chain |
|---|---|
| code-review | For full code review including non-security concerns |
| review-architecture | When security issues stem from architectural problems |
| review-migration | When reviewing migration security (data exposure, constraints) |
| security-review-process (from ruby-core-skills) | Process discipline: OWASP checklist, Ruby-level security concerns |
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub fcakiroglu16/marketplace --plugin ruby-on-rails7 skills in this plugin
/implement-authorizationUse when adding or reviewing Rails authorization with Pundit, CanCanCan, or policy objects. Trigger words: authorization, Pundit, CanCanCan, policy, roles, permissions./implement-background-jobUse when adding or reviewing an Active Job / Sidekiq / Solid Queue worker. Cover idempotency, retry_on, and discard_on. Trigger words: background job, Active Job, Sidekiq, Solid Queue, worker./implement-hotwireUse when adding Turbo Frames, Turbo Streams, or Stimulus controllers. Trigger words: Hotwire, Turbo, Stimulus, frames, streams.Other plugins' skills for the same job