Skip to main content

Security

Enabled by default (modules.security = true).

Secret Exposure — SEC-

Detects hardcoded credentials and API keys in source files.

FindingSeverityWhat it matches
SEC-001ErrorAWS access key (AKIA...)
SEC-002ErrorAWS secret access key (context + 40-char value)
SEC-003ErrorGitHub token (ghp_..., gho_..., ghu_...)
SEC-004ErrorPrivate key PEM block
SEC-005ErrorDatabase connection string with credentials
SEC-006ErrorStripe live secret / restricted key (sk_live_..., rk_live_...)
SEC-007ErrorSlack token (xoxb-..., xoxp-..., xoxa-..., xoxs-...)
SEC-008ErrorSendGrid API key (SG....)
SEC-009ErrorTwilio auth token (context + 32-char hex value)
SEC-010ErrorAzure Storage connection string
SEC-011WarningStripe live publishable key (pk_live_...)
SEC-012WarningGCP service account email embedded in source
SEC-013WarningBase64-encoded secret in sensitive variable (40+ char value)
SEC-014WarningGeneric API key assignment (api_key = "...")
SEC-015WarningGeneric secret key assignment (secret_key = "...")
SEC-016WarningHardcoded password (password = "...")

Suppression: Add # revet-ignore SEC on the offending line for test fixtures.

SQL Injection — SQL-

Detects unsafe SQL construction via string interpolation or concatenation. Covers Python, JavaScript/TypeScript, Rust, Go, and Java.

FindingSeverityWhat it matches
SQL-001Errorf-string or .format() inside .execute() (Python)
SQL-002ErrorString concatenation (+) in SQL query
SQL-003Errorformat!("...SQL...{}", var) macro (Rust)
SQL-004Errorfmt.Sprintf("...SQL...%s", var) (Go)
SQL-005ErrorString.format("...SQL...", var) (Java)
SQL-006ErrorJava string + concatenation in SQL
SQL-007WarningTemplate literal in SQL (JS/TS)
SQL-008WarningStandalone f-string or .format() SQL assignment

Fix: Use parameterized queries or an ORM.

# Bad — flagged
cursor.execute(f"SELECT * FROM users WHERE id = {user_id}")

# Good — safe
cursor.execute("SELECT * FROM users WHERE id = %s", (user_id,))
// Bad — flagged
let q = format!("SELECT * FROM users WHERE id = {}", id);

// Good — safe (sqlx)
sqlx::query!("SELECT * FROM users WHERE id = ?", id)
// Bad — flagged
query := fmt.Sprintf("SELECT * FROM users WHERE name = '%s'", name)

// Good — safe
rows, _ := db.Query("SELECT * FROM users WHERE name = ?", name)
// Bad — flagged
String q = String.format("SELECT * FROM users WHERE id = %d", userId);
String q2 = "SELECT * FROM users WHERE name = '" + username + "'";

// Good — safe
PreparedStatement ps = conn.prepareStatement("SELECT * FROM users WHERE id = ?");
ps.setInt(1, userId);

Command Injection — CMD-

Detects user-controlled input flowing into shell execution calls. Covers Python, JavaScript/TypeScript, Go, Ruby, and shell scripts.

FindingSeverityWhat it matches
CMD-001Errorsubprocess.*(..., shell=True) (Python)
CMD-002Erroros.system() call (Python)
CMD-003Erroros.popen() call (Python)
CMD-004Errorcommands.getoutput() (Python — deprecated)
CMD-005Errorexec() / execSync() with template literal (JS/TS)
CMD-006Errorexec() with string concatenation (JS/TS)
CMD-007Errorspawn() with shell: true (JS/TS)
CMD-008Errorexec.Command("sh", "-c", ...) (Go)
CMD-009ErrorBacktick with string interpolation `#{...}` (Ruby)
CMD-010Error%x{...#{}...} shell execution (Ruby)
CMD-011Errorsystem("...#{...}...") (Ruby)
CMD-012Erroreval $variable (shell scripts)

Fix: Never pass user input to shell interpreters. Use argument arrays instead of shell strings.

# Bad — flagged
subprocess.run(f"convert {user_file} output.png", shell=True)
os.system(f"rm -rf {path}")

# Good — safe
subprocess.run(["convert", user_file, "output.png"])
// Bad — flagged
exec(`git clone ${repoUrl} /tmp/repo`);

// Good — safe
execFile("git", ["clone", repoUrl, "/tmp/repo"]);

Suppression: Add # revet-ignore CMD on the offending line if the input is validated.

Insecure Deserialization — DESER-

Detects unsafe deserialization of untrusted data, which can lead to Remote Code Execution. Covers Python, PHP, Java, and Ruby.

FindingSeverityWhat it matches
DESER-001Erroryaml.load() without SafeLoader or BaseLoader (Python)
DESER-002Errorpickle.load() / pickle.loads() (Python)
DESER-003ErrorcPickle.load() / cPickle.loads() (Python)
DESER-004Errormarshal.loads() (Python)
DESER-005Errorjsonpickle.decode() (Python)
DESER-006Errorunserialize() (PHP)
DESER-007Errornew ObjectInputStream( (Java)
DESER-008ErrorMarshal.load() (Ruby)
DESER-009WarningYAML.load() without safe_load (Ruby)

Fix: Use safe alternatives that cannot instantiate arbitrary objects.

# Bad — flagged
data = yaml.load(stream)
obj = pickle.loads(request.body)

# Good — safe
data = yaml.safe_load(stream)
obj = json.loads(request.body)
// Bad — flagged
ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());

// Good — use Jackson or an ObjectInputFilter allowlist
MyDto dto = objectMapper.readValue(json, MyDto.class);

Note: pickle.load/loads is also detected by the ML Pipeline analyzer in the ML context. If both security and ml modules are enabled, pickle may produce findings from both — suppress with # revet-ignore DESER or # revet-ignore ML as appropriate.

Suppression: Add # revet-ignore DESER on the offending line for known-safe or internal-only deserialization.

SSRF — SSRF-

Detects HTTP client calls where the URL is not a hardcoded string literal — a variable or interpolated string that could be influenced by user input. Covers Python, JavaScript/TypeScript, Go, and Java.

FindingSeverityWhat it matches
SSRF-001Errorrequests.*() with f-string URL (Python)
SSRF-002Warningrequests.*() with variable URL (Python)
SSRF-003Errorurllib.urlopen() with f-string URL (Python)
SSRF-004Warningurllib.urlopen() with variable URL (Python)
SSRF-005Errorhttpx.*() with f-string URL (Python)
SSRF-006Warninghttpx.*() with variable URL (Python)
SSRF-007Errorfetch() with template literal URL (JS/TS)
SSRF-008Warningfetch() with variable URL (JS/TS)
SSRF-009Erroraxios.*() with template literal URL (JS/TS)
SSRF-010Warningaxios.*() with variable URL (JS/TS)
SSRF-011Warninghttp.Get/Post/Head() with variable URL (Go)
SSRF-012Errorhttp.Get/Post/Head(fmt.Sprintf(...)) (Go)
SSRF-013Warningnew URL(variable) (Java)
SSRF-014Errornew URL("..." + variable) concatenation (Java)

Error severity = explicit interpolation (f-string / template literal / concatenation). Warning severity = variable URL (may be internally controlled — review context).

# Bad — flagged (Error)
resp = requests.get(f"http://internal/{user_input}")

# Bad — flagged (Warning)
resp = requests.get(target_url)

# Good — not flagged
resp = requests.get("https://api.example.com/data")

Suppression: Add # revet-ignore SSRF on the line if the URL is validated and allowlisted before use.

Path Traversal — PATH-

Detects unsanitized user input flowing into file system operations (CWE-22). Covers Python, JavaScript/TypeScript, PHP, Go, and Java.

FindingSeverityWhat it matches
PATH-001Erroropen(f"...") with f-string path (Python)
PATH-002Erroropen(... + "../") with ../ traversal sequence (Python)
PATH-003Warningos.path.join(variable, ...) with variable first argument (Python)
PATH-004ErrorPath(f"...") pathlib with f-string argument (Python)
PATH-005Errorfs.readFile/writeFile/appendFile with template literal path (JS/TS)
PATH-006Warningfs.readFile/writeFile/appendFile with variable path (JS/TS)
PATH-007Errorpath.join() with template literal segment (JS/TS)
PATH-008Errorpath.join() with ../ sequence (JS/TS)
PATH-009Errorinclude/require($variable) — LFI risk (PHP)
PATH-010Errorfile_get_contents($_GET/POST/REQUEST/COOKIE/SERVER) (PHP)
PATH-011Warningfile_get_contents($variable) (PHP)
PATH-012Erroros.Open/ReadFile(fmt.Sprintf(...)) (Go)
PATH-013Warningos.Open/ReadFile(variable) (Go)
PATH-014Errornew File("..." + variable) string concatenation (Java)
PATH-015WarningPaths.get(variable) with variable argument (Java)

Error severity = explicit interpolation or ../ traversal sequences. Warning severity = variable path (may be internally controlled — review context).

# Bad — flagged (Error)
with open(f"/data/{filename}") as f: ...
p = Path(f"/uploads/{user_file}")

# Bad — flagged (Warning)
full_path = os.path.join(user_dir, filename)

# Good — not flagged
with open("config/settings.toml") as f: ...
// Bad — flagged (Error)
fs.readFile(`/uploads/${req.params.name}`, callback);
const p = path.join(root, '../', userInput);

// Bad — flagged (Warning)
fs.readFile(filePath, 'utf8', callback);

// Good — not flagged
fs.readFile("./config/settings.json", "utf8", callback);

Suppression: Add # revet-ignore PATH on the line if the path is validated and canonicalized before use.

Sensitive Data in Logs — LOG-

Detects credentials and secrets passed to logging or print calls (CWE-532). Log files are often forwarded to third-party aggregators and stored long-term, making them a secondary exposure risk. Covers Python, JavaScript/TypeScript, PHP, Go, Java, and Ruby.

FindingSeverityWhat it matches
LOG-001WarningSensitive variable in Python logging.* / log.* / logger.* call
LOG-002WarningSensitive variable in Python print()
LOG-003WarningSensitive variable in JS/TS console.*
LOG-004WarningSensitive variable in JS/TS logger.*
LOG-005WarningSensitive variable in Go fmt.Print* / log.Print*
LOG-006WarningSensitive variable in Java System.out.println / logger.*
LOG-007WarningSensitive variable in PHP error_log() / var_dump()
LOG-008WarningSensitive variable in Ruby puts / p / pp

Sensitive variable names detected: password, passwd, pwd, secret, token, api_key, credential, auth_key, private_key (and camelCase equivalents for Go/Java).

# Bad — flagged
logging.debug(password)
logging.info(f"token={token}")
print(api_key)

# Good — not flagged
logging.info("Login successful for user %s", username)
logging.debug("Request count: %d", count)
// Bad — flagged
console.log(password);
logger.info({ token });

// Good — not flagged
console.log("Server listening on port", port);

Suppression: Add # revet-ignore LOG on the line if the value is intentionally redacted before logging.