agentleFS
NoorQureshiNoorQureshi/SploitAgent/skills/code-review/code-review-ruby/SKILL.md

code-review-ruby

Skill26 starsChanged 31 days agoMITView on GitHub

Security review of Ruby code — dangerous sinks and Rails pitfalls. Load when reviewing a Ruby/Rails codebase/PR, on .rb source in scope, or "review this Rails app". Signals: Gemfile, config/routes.rb, ActiveRecord, ERB, YAML.load, send/constantize.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run brakeman and bundler-audit.

    line 45
  2. Very specific:

    Check every controller's strong-params and before_action auth coverage.

    line 47

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Ruby / Rails source review

When it applies

Reviewing Ruby source, usually Rails. Rails is safe by default in many places, so the bugs cluster in dynamic dispatch, mass assignment gaps, raw SQL, and unsafe deserialization/rendering.

Why it works

Ruby's metaprogramming (send, constantize, eval) turns strings into method/class/code references, and Rails helpers have unsafe escape hatches (.html_safe, where("...#{x}..."), render inline:). Tracing params to these is the whole game — and Brakeman automates the first pass.

Sinks & patterns (grep, then trace to user input)

  • Code exec: eval, instance_eval, class_eval, backticks/system/%x/exec/open("|…").
  • Dynamic dispatch: send/public_send/__send__ with a param method name; constantize/ safe_constantize on input (arbitrary class instantiation).
  • SQLi: string interpolation in where("name = '#{x}'"), find_by_sql, order(params[:sort]), pluck/group with input.
  • Mass assignment: missing/loose Strong Parameters (params.permit!, permit(*keys)).
  • Deserialization: YAML.load(vs safe_load), Marshal.load, Oj in compat mode on input.
  • XSS/SSRF/render: .html_safe/raw on user data, render inline:/render text: with input, open/Net::HTTP on user URLs, send_file/params[:path] traversal.

Framework specifics

  • Rails: permit/require correctness, skip_before_action :verify_authenticity_token (CSRF), redirect_to params[...] (open redirect), route globbing exposing actions, secrets in credentials/ENV, default protect_from_forgery disabled on APIs.

Method

  1. Run brakeman and bundler-audit; triage the warnings (Brakeman is high-signal for Rails).
  2. rg 'send\(|constantize|eval|where\(".*#\{|html_safe|YAML.load|render.*inline' → trace to params.
  3. Check every controller's strong-params and before_action auth coverage.
  4. Confirm exploitable findings with web-sqli, web-deserialization, web-ssrf, web-idor.

Gotchas

  • send to a fixed symbol is fine; the bug is send(params[:action]).
  • YAML.safe_load is safe; plain YAML.load on input is RCE-capable.
  • Brakeman false positives exist — always confirm the param actually reaches the sink.

References

Brakeman docs; Rails Security Guide; OWASP Ruby on Rails cheat sheet.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.