vuln-patterns-languages
Language-specific vulnerability detection patterns for JavaScript/TypeScript, Python, Go, Java, Ruby, and PHP. Provides regex patterns and grep commands for common security vulnerabilities.
What this skill does
# Vulnerability Patterns: Language-Specific
Detection patterns organized by programming language.
## When to Use This Skill
- **Language-targeted scans** - When auditing specific tech stacks
- **Code review** - Finding vulnerabilities in PRs
- **Building auditor agents** - Patterns for domain auditors
## When NOT to Use This Skill
- **Universal patterns** - Use vuln-patterns-core skill
- **Full audits** - Use domain auditor agents
- **Remediation** - Use remediation-* skills
---
## JavaScript/TypeScript Patterns
### Dangerous eval()
**Detection Pattern**:
```regex
# eval with variables
eval\s*\([^)]*[a-zA-Z_]+[^)]*\)
# Function constructor
new\s+Function\s*\([^)]*[a-zA-Z_]+
# setTimeout/setInterval with string
(setTimeout|setInterval)\s*\([^,)]*['"`]
```
**Grep Commands**:
```bash
grep -rn --include="*.{js,ts}" -E "eval\s*\(" .
grep -rn --include="*.{js,ts}" -E "new\s+Function\s*\(" .
grep -rn --include="*.{js,ts}" -E "(setTimeout|setInterval)\s*\(['\"\`]" .
```
**Severity**: Critical
**ASVS**: V1.5.1 - Safe deserialization
**CWE**: CWE-94 (Code Injection)
---
### XSS via DOM Manipulation
**Detection Pattern**:
```regex
# innerHTML assignment
\.innerHTML\s*=(?!\s*['"]<[^>]+>[^<]*</[^>]+>['"])
# document.write
document\.write\s*\(
# insertAdjacentHTML
\.insertAdjacentHTML\s*\(
# React dangerouslySetInnerHTML
dangerouslySetInnerHTML
```
**Grep Commands**:
```bash
grep -rn --include="*.{js,ts,jsx,tsx}" "\.innerHTML\s*=" .
grep -rn --include="*.{js,ts,jsx,tsx}" "document\.write" .
grep -rn --include="*.{js,ts,jsx,tsx}" "dangerouslySetInnerHTML" .
```
**Severity**: High
**ASVS**: V3.3.1 - XSS prevention
**CWE**: CWE-79 (Cross-site Scripting)
---
### Prototype Pollution
**Detection Pattern**:
```regex
# Direct __proto__ access
__proto__
# Object merge without validation
Object\.assign\s*\([^)]*,[^)]*\)
\.\.\.(?!props)[a-zA-Z_]+
# Bracket notation with variable
\[[a-zA-Z_]+\]\s*=
```
**Grep Commands**:
```bash
grep -rn --include="*.{js,ts}" "__proto__" .
grep -rn --include="*.{js,ts}" "constructor\s*\[" .
```
**Severity**: High
**ASVS**: V1.5.1 - Safe deserialization
**CWE**: CWE-1321 (Prototype Pollution)
---
### Insecure Randomness
**Detection Pattern**:
```regex
Math\.random\s*\(\)
```
**Context**: Only flag when used for security purposes (tokens, keys, IDs)
**Grep Commands**:
```bash
grep -rn --include="*.{js,ts}" "Math\.random" .
```
**Severity**: Medium (context-dependent)
**ASVS**: V11.3.1 - CSPRNG for security values
**CWE**: CWE-330 (Insufficient Randomness)
---
### Missing Security Headers (Express)
**Detection Pattern**:
```regex
# Express without helmet
app\s*=\s*express\s*\(\)(?!.*helmet)
```
**Grep Commands**:
```bash
grep -rn --include="*.{js,ts}" "express()" . | grep -v helmet
grep -rn --include="*.{js,ts}" "helmet" .
```
**Severity**: Medium
**ASVS**: V3.4.1 - Security headers
**CWE**: CWE-693 (Protection Mechanism Failure)
---
## Python Patterns
### Unsafe Deserialization
**Detection Pattern**:
```regex
# Pickle with untrusted data
pickle\.(loads?|load)\s*\(
# YAML unsafe load
yaml\.(load|unsafe_load)\s*\([^)]*(?!Loader\s*=\s*yaml\.SafeLoader)
# Marshal load
marshal\.loads?\s*\(
```
**Grep Commands**:
```bash
grep -rn --include="*.py" "pickle\.load" .
grep -rn --include="*.py" "yaml\.load" . | grep -v "SafeLoader\|safe_load"
grep -rn --include="*.py" "marshal\.load" .
```
**Severity**: Critical
**ASVS**: V1.5.1 - Safe deserialization
**CWE**: CWE-502 (Deserialization of Untrusted Data)
---
### Weak Cryptography
**Detection Pattern**:
```regex
# MD5/SHA1 for security
hashlib\.(md5|sha1)\s*\(
# DES/RC4
DES\.|RC4\.|Blowfish\.
# ECB mode
\.MODE_ECB
```
**Grep Commands**:
```bash
grep -rn --include="*.py" "hashlib\.md5\|hashlib\.sha1" .
grep -rn --include="*.py" "MODE_ECB" .
grep -rn --include="*.py" -E "DES\.|RC4\." .
```
**Severity**: High
**ASVS**: V11.5.2 - No MD5/SHA1
**CWE**: CWE-327 (Broken Crypto Algorithm)
---
### Insecure Random
**Detection Pattern**:
```regex
# random module for security
random\.(choice|randint|random|randrange|sample)\s*\(
```
**Context**: Flag when used for tokens, keys, session IDs
**Grep Commands**:
```bash
grep -rn --include="*.py" -E "random\.(choice|randint|random|randrange)" . | grep -i "token\|key\|session\|secret\|password"
```
**Severity**: High
**ASVS**: V11.3.1 - CSPRNG
**CWE**: CWE-338 (Weak PRNG)
---
### Hardcoded Flask Secret Key
**Detection Pattern**:
```regex
SECRET_KEY\s*=\s*['"][^'"]+['"]
app\.secret_key\s*=\s*['"][^'"]+['"]
```
**Grep Commands**:
```bash
grep -rn --include="*.py" "SECRET_KEY\s*=\s*['\"]" .
grep -rn --include="*.py" "secret_key\s*=\s*['\"]" .
```
**Severity**: High
**ASVS**: V13.3.1 - Secrets management
**CWE**: CWE-798 (Hardcoded Credentials)
---
### Debug Mode in Production
**Detection Pattern**:
```regex
DEBUG\s*=\s*True
app\.run\s*\([^)]*debug\s*=\s*True
FLASK_DEBUG\s*=\s*['"]?1
```
**Grep Commands**:
```bash
grep -rn --include="*.py" "DEBUG\s*=\s*True" .
grep -rn --include="*.py" "debug\s*=\s*True" .
```
**Severity**: High
**ASVS**: V13.2.1 - Debug disabled in production
**CWE**: CWE-489 (Active Debug Code)
---
### TLS Verification Disabled
**Detection Pattern**:
```regex
verify\s*=\s*False
REQUESTS_CA_BUNDLE\s*=\s*['"]?$
urllib3\.disable_warnings
```
**Grep Commands**:
```bash
grep -rn --include="*.py" "verify\s*=\s*False" .
grep -rn --include="*.py" "disable_warnings" .
```
**Severity**: High
**ASVS**: V12.3.1 - Certificate validation
**CWE**: CWE-295 (Improper Certificate Validation)
---
## Go Patterns
### SQL Injection
**Detection Pattern**:
```regex
# fmt.Sprintf in queries
fmt\.Sprintf\s*\([^)]*SELECT
db\.(Query|Exec)\s*\([^)]*\+
# String concatenation
"SELECT.*"\s*\+
```
**Grep Commands**:
```bash
grep -rn --include="*.go" -E "fmt\.Sprintf.*SELECT|fmt\.Sprintf.*INSERT" .
grep -rn --include="*.go" -E "db\.(Query|Exec)\s*\(.*\+" .
```
**Severity**: Critical
**ASVS**: V1.2.1 - Parameterized queries
**CWE**: CWE-89 (SQL Injection)
---
### Weak Cryptography
**Detection Pattern**:
```regex
crypto/md5
crypto/sha1
crypto/des
crypto/rc4
```
**Grep Commands**:
```bash
grep -rn --include="*.go" "crypto/md5\|crypto/sha1\|crypto/des\|crypto/rc4" .
```
**Severity**: High
**ASVS**: V11.5.2 - No deprecated algorithms
**CWE**: CWE-327 (Broken Crypto)
---
### Insecure TLS Config
**Detection Pattern**:
```regex
InsecureSkipVerify\s*:\s*true
MinVersion\s*:\s*tls\.VersionSSL
MinVersion\s*:\s*tls\.VersionTLS10
```
**Grep Commands**:
```bash
grep -rn --include="*.go" "InsecureSkipVerify.*true" .
grep -rn --include="*.go" "MinVersion.*SSL\|MinVersion.*TLS10\|MinVersion.*TLS11" .
```
**Severity**: High
**ASVS**: V12.2.1 - TLS 1.2+
**CWE**: CWE-295 (Certificate Validation)
---
## Java Patterns
### SQL Injection
**Detection Pattern**:
```regex
# String concatenation
Statement\s+\w+\s*=.*createStatement
executeQuery\s*\([^?]*\+
"SELECT.*"\s*\+
# PreparedStatement misuse
prepareStatement\s*\([^?]*\+
```
**Grep Commands**:
```bash
grep -rn --include="*.java" "createStatement" .
grep -rn --include="*.java" -E "executeQuery\s*\(.*\+" .
grep -rn --include="*.java" -E "\"SELECT.*\"\s*\+" .
```
**Severity**: Critical
**ASVS**: V1.2.1 - Parameterized queries
**CWE**: CWE-89 (SQL Injection)
---
### Unsafe Deserialization
**Detection Pattern**:
```regex
ObjectInputStream
readObject\s*\(\)
XMLDecoder
XStream(?!.*allowTypes)
```
**Grep Commands**:
```bash
grep -rn --include="*.java" "ObjectInputStream\|readObject()" .
grep -rn --include="*.java" "XMLDecoder" .
```
**Severity**: Critical
**ASVS**: V1.5.1 - Safe deserialization
**CWE**: CWE-502 (Deserialization)
---
### XXE Vulnerability
**Detection Pattern**:
```regex
DocumentBuilderFactory(?!.*setFeature.*FEATURE_SECURE)
SAXParserFactory(?!.*setFeature)
XMLInputFactory(?!.*setProperty.*SUPPORT_DTD)
```
**Grep Commands**:
```bash
grep -rn --include="*.java" "DocumentBuilderFactory\|SAXParserFactory\|XMLInputFactory" .
```
**Severity**: High
**ASVS*Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.