Security Rules
Qryon includes 647+ security rules covering OWASP Top 10, CWE, and language-specific vulnerabilities. Rules are Semgrep-compatible and can be extended with custom patterns.
Rule Categories
Injection Vulnerabilities (A03:2021)
| Rule ID | Description | Languages |
|---|
sql-injection | SQL query with unsanitized input | JS, TS, Python, Java, Go |
nosql-injection | NoSQL query injection (MongoDB, etc.) | JS, TS, Python |
command-injection | OS command with user input | All |
ldap-injection | LDAP query with unsanitized input | Java, Python |
xpath-injection | XPath query with unsanitized input | Java, Python |
template-injection | Server-side template injection | Python, JS |
Cross-Site Scripting (A03:2021)
| Rule ID | Description | Languages |
|---|
xss-reflected | Reflected XSS via request parameters | JS, TS, Python, Java |
xss-stored | Stored XSS from database content | JS, TS, Python, Java |
xss-dom | DOM-based XSS via client-side code | JS, TS |
react-unsafe-render | React unsafe HTML rendering | JS, TS |
angular-bypass-security | Angular security bypass methods | TS |
Broken Access Control (A01:2021)
| Rule ID | Description | Languages |
|---|
path-traversal | Directory traversal via user input | All |
ssrf | Server-side request forgery | All |
open-redirect | Unvalidated redirect destination | JS, TS, Python, Java |
idor | Insecure direct object reference | All |
cors-misconfiguration | Overly permissive CORS settings | JS, TS, Python, Java |
Cryptographic Failures (A02:2021)
| Rule ID | Description | Languages |
|---|
weak-crypto-algorithm | Use of MD5, SHA1, DES, etc. | All |
hardcoded-secret | Secrets in source code | All |
weak-random | Math.random() for security | JS, TS, Python, Java |
missing-encryption | Sensitive data without encryption | All |
weak-tls | TLS versions below 1.2 or weak ciphers | All |
Insecure Deserialization (A08:2021)
| Rule ID | Description | Languages |
|---|
unsafe-deserialization | Deserializing untrusted data | Python, Java |
unsafe-object-loading | Loading serialized objects unsafely | Python |
yaml-unsafe-load | Unsafe YAML loading | Python |
java-object-input | Java ObjectInputStream vulnerabilities | Java |
Security Misconfiguration (A05:2021)
| Rule ID | Description | Languages |
|---|
debug-enabled | Debug mode in production | All |
verbose-errors | Stack traces exposed to users | All |
missing-security-headers | Missing CSP, HSTS, etc. | JS, TS, Python, Java |
default-credentials | Default passwords or keys | All |
Rule Severity Levels
# View rules by severity
rma rules list --severity critical
rma rules list --severity high
# Override severity in config
[rules.severity_override]
"react-unsafe-render" = "critical"
"missing-alt-text" = "info"
Enabling/Disabling Rules
# Disable specific rules
rma scan . --disable sql-injection --disable xss-reflected
# Enable only specific rules
rma scan . --enable sql-injection --enable command-injection
# Disable rule categories
rma scan . --disable "style-*"
# Configuration file
[rules]
disabled = [
"style-*",
"info-*",
"javascript/console-log"
]
enabled = [
"security/*",
"owasp/*"
]
Rule Information
# List all rules
rma rules list
# Show rule details
rma rules info sql-injection
# Output:
Rule: sql-injection
Severity: HIGH
Languages: javascript, typescript, python, java, go
Category: security/injection
CWE: CWE-89
Description:
SQL injection occurs when untrusted data is sent to an interpreter
as part of a command or query. This can allow attackers to run
arbitrary SQL commands.
Pattern:
query($USER_INPUT)
where $USER_INPUT is tainted from request
References:
- https://owasp.org/Top10/A03_2021-Injection/
- https://cwe.mitre.org/data/definitions/89.html
Examples:
Bad:
db.query(`SELECT * FROM users WHERE id = '${req.params.id}'`)
Good:
db.query('SELECT * FROM users WHERE id = ?', [req.params.id])
Rule Statistics
| Category | Rule Count |
|---|
| Injection | 87 |
| XSS | 45 |
| Access Control | 62 |
| Cryptography | 78 |
| Authentication | 54 |
| Secrets | 120 |
| Configuration | 89 |
| Other | 112 |
| Total | 647+ |
Language-Specific Rules
JavaScript/TypeScript
- React security patterns
- Node.js specific (child_process, fs)
- Express.js middleware issues
- Prototype pollution
- npm package vulnerabilities
Python
- Django/Flask security patterns
- Unsafe deserialization
- subprocess injection
- SQL injection in ORMs
- SSTI in Jinja2/Mako
Java
- Spring Security misconfigurations
- JDBC SQL injection
- XXE in XML parsers
- Insecure ObjectInputStream
- Log injection
Go
- SQL injection in database/sql
- Command injection via os/exec
- Weak crypto packages
- HTTP security headers
Rust
- Unsafe block misuse
- SQL injection via sqlx/diesel
- Memory safety issues
- Crypto library usage
Next Steps