ScanningSAST by Language

Ruby SAST

What xgrep detects in Ruby — injection, XSS, mass assignment, deserialization, weak crypto, and supply-chain backdoors — including Rails and ERB.

Ruby SAST

xgrep parses .rb into tree-sitter ASTs and ships roughly 50 rules, with coverage for Rails patterns and ERB templates. Detection here is mostly precise structural matching, with taint mode reserved for select flows.

xgrep scan --include '*.rb' .

What xgrep detects

Injectionsql-injection, pg-injection, command-injection, code-injection, header-injection, format-string, log-injection.

Cross-site scriptingxss, erb-unescaped-output, erb-inline-js-injection, erb-tainted-output.

Mass assignmentmass-assignment (unfiltered attribute binding into models).

Deserialization & XMLunsafe-deserialization, xxe.

SSRF, redirects & MITMssrf, open-redirect, mitm.

Path traversal & filespath-traversal, file-permissions.

Auth & CSRFcsrf, sensitive-get (state-changing GET), weak-cookie-configuration.

Crypto & TLSweak-cipher, insecure-tls, disabled-cert-validation, cleartext-storage, timing-attack-string-comparison.

Availability (DoS)regex-dos, redos, decompression.

Supply chain & backdoorsbackdoor, hidden-backdoor, insecure-source, untrusted-code, untrusted-input flag planted or untrusted code paths.

Correctnessvariables-dead-store, variables-uninitialized-local, use-detect, database-query-in-loop (run with --category correctness).

Taint analysis

A small number of rules use taint mode for the highest-value flows; most Ruby/Rails rules match precise structural patterns (controller params, ERB output, ActiveRecord queries), which is the reliable signal for these idioms.

See also Secrets scanning and the CLI reference.

On this page