llm-sast-scanner

General-purpose Static Application Security Testing (SAST) skill for code vulnerability analysis. Trigger when the user asks to: "analyze code for vulnerabil...

MIT-0 · Free to use, modify, and redistribute. No attribution required.
0 · 53 · 0 current installs · 0 all-time installs
MIT-0
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name, description, and the bundled reference files align with a general-purpose static analysis skill. The listed vulnerability classes and detection heuristics are appropriate for a SAST scanner and the skill does not request unrelated binaries, credentials, or platform access.
Instruction Scope
SKILL.md contains detailed, targeted instructions to load the included reference files and perform source→sink taint analysis on code. This is within scope for a SAST skill. One ambiguous item: the taint 'Sources' list includes 'environment variables' (as a class of inputs to look for in the code); the document does not instruct the agent to read the host runtime environment or system secrets. If installed/used, the agent will need access to the user's code/repository when invoked — which is expected but worth noting to users who may not want their repos scanned automatically.
Install Mechanism
No install spec and no code files are present beyond documentation; nothing is downloaded or written to disk by an installer as part of the skill. This minimizes supply-chain risk.
Credentials
The skill requests no environment variables, credentials, or config paths. The references mention environment variables only as a possible source of taint when analyzing code — that is reasonable and proportionate for static analysis.
Persistence & Privilege
always:false and no special privileges are requested. The skill does not require permanent presence or modification of other skills/configs. Autonomous invocation is allowed (platform default) but is not combined here with broad credentials or persistence.
Assessment
This is an instruction-only SAST skill composed of vulnerability reference documents and analysis guidance; it does not install binaries or ask for credentials. Before installing, be aware that: (1) when you invoke it you will need to provide the code/repository for analysis — the skill will read those files to produce findings, (2) the references treat environment variables as potential taint sources in the codebase, but the skill does not read your runtime environment unless you explicitly provide it, and (3) autonomous invocation is allowed by default on the platform — if you do not want the agent to run the skill without your prompt, adjust invocation settings. If you plan to use it on private code, review the findings and outputs the agent will produce to avoid accidental disclosure of secrets in reports.

Like a lobster shell, security has layers — review code before you run it.

Current versionv1.0.1
Download zip
latestvk97bvkscypswgcv3p80mm2jw8x841r7b

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

SKILL.md

SAST Vulnerability Analysis

Purpose

Systematically analyze source code for security vulnerabilities using structured Source→Sink taint tracking, pattern matching, and vulnerability-class-specific detection heuristics. Produce actionable findings with severity ratings, affected code locations (file + line number), and remediation guidance.

Scope

This skill covers the following 34 vulnerability classes. Each has a dedicated reference file loaded on demand:

CategoryVulnerabilities
InjectionSQL Injection, XSS, SSTI, NoSQL Injection, GraphQL Injection, XXE, RCE / Command Injection, Expression Language Injection
Access Control & AuthIDOR, Privilege Escalation, Authentication/JWT, Default Credentials, Brute Force, Business Logic, HTTP Method Tampering, Verification Code Abuse, Session Fixation
Data Exposure & CryptoWeak Crypto/Hash, Information Disclosure, Insecure Cookie, Trust Boundary
Server-SideSSRF, Path Traversal/LFI/RFI, Insecure Deserialization, Arbitrary File Upload, JNDI Injection, Race Conditions
Protocol & InfrastructureCSRF, Open Redirect, HTTP Request Smuggling/Desync, Denial of Service, CVE Patterns
Language/PlatformPHP Security, Mobile Security (Android/iOS)

Workflow

Step 1: Understand Scope

Determine:

  • Target: single file, directory, API endpoint, module, or full repo
  • Language(s) and framework(s) in use
  • User's goal: quick scan, deep audit, specific vuln class, or full report

Step 2: Load Relevant References

Based on the code being reviewed, load the appropriate reference files from references/:

references/sql_injection.md          — SQL / ORM injection
references/xss.md                    — Cross-site scripting
references/ssrf.md                   — Server-side request forgery
references/rce.md                    — Remote code execution
references/idor.md                   — Insecure direct object reference
references/authentication_jwt.md     — Auth flaws, JWT weaknesses
references/csrf.md                   — Cross-site request forgery
references/path_traversal_lfi_rfi.md — Path traversal, LFI/RFI
references/ssti.md                   — Server-side template injection
references/xxe.md                    — XML external entity
references/insecure_deserialization.md    — Insecure deserialization
references/arbitrary_file_upload.md      — Arbitrary file upload
references/privilege_escalation.md       — Privilege escalation
references/nosql_injection.md            — NoSQL injection
references/graphql_injection.md          — GraphQL injection
references/weak_crypto_hash.md           — Weak cryptography / hash
references/information_disclosure.md     — Information disclosure
references/insecure_cookie.md            — Insecure cookie attributes
references/open_redirect.md              — Open redirect
references/trust_boundary.md             — Trust boundary violations
references/race_conditions.md            — Race conditions / TOCTOU
references/brute_force.md                — Brute force / credential stuffing
references/default_credentials.md        — Default / hardcoded credentials
references/verification_code_abuse.md    — Verification code abuse
references/business_logic.md             — Business logic flaws
references/http_method_tamper.md         — HTTP method tampering
references/smuggling_desync.md           — HTTP request smuggling / desync
references/cve_patterns.md               — Known CVE patterns
references/expression_language_injection.md — Expression language injection (SpEL / OGNL)
references/jndi_injection.md             — JNDI injection (Log4Shell class)
references/denial_of_service.md          — Denial of service / resource exhaustion
references/php_security.md               — PHP-specific security issues
references/mobile_security.md            — Mobile security (Android / iOS)
references/session_fixation.md           — Session fixation

Loading strategy:

  • For a targeted review (e.g., "check for SQL injection"), load only the relevant reference(s).
  • For a full audit, load all 34 references and scan systematically.
  • Always load references for the top OWASP risks even if not explicitly requested.

Step 3: Analyze Code — Source→Sink Taint Tracking

For each loaded vulnerability class, perform taint analysis:

  1. Identify Sources — User-controlled input entry points:

    • HTTP params, headers, cookies, request body
    • File uploads
    • WebSocket messages
    • Environment variables
    • Database reads of user-supplied data, deserialized objects
  2. Trace Data Flow — Follow the data through:

    • Variable assignments, function arguments, return values
    • Framework helpers, ORM calls, template rendering
    • Cross-module/service boundaries
  3. Check Sinks — Dangerous operations receiving tainted data:

    • Query execution (SQL, NoSQL, LDAP, XPath)
    • Shell/OS command execution
    • File system operations
    • HTTP client calls
    • Template rendering / eval / expression parsing
    • Serialization/deserialization
  4. Evaluate Sanitization — Between source and sink, look for:

    • Input validation (allowlist vs denylist)
    • Context-appropriate encoding/escaping
    • Parameterization (prepared statements)
    • Framework-native protections
  5. Determine Preliminary Verdict:

    • VULN: Taint reaches sink with no effective sanitization
    • LIKELY VULN: Sanitization present but bypassable per reference heuristics
    • SAFE: Effective sanitization or no taint path

Step 4: Business Logic & Auth Analysis

Beyond taint tracking, check for:

  • Missing authentication/authorization on sensitive endpoints
  • Insecure state machine transitions
  • Race conditions in concurrent operations
  • Improper trust boundaries between components
  • JWT algorithm confusion, token fixation, session issues
  • Default/hardcoded credentials
  • Enumeration via timing or response differences

Step 5: Judge — Validity Re-Verification

Before reporting, every preliminary finding (VULN or LIKELY VULN) must pass a Judge review. The Judge acts as an adversarial second opinion to eliminate false positives.

For each candidate finding, answer all of the following:

Reachability Check

  • Is the source actually user-controlled, or is it internal/trusted data?
  • Is the vulnerable code path reachable from an HTTP endpoint / entry point, or is it dead code / internal-only?
  • Are there upstream guards (auth middleware, input filters) that block the path before it reaches the sink?

Sanitization Re-Evaluation

  • Is there sanitization that was missed in Step 3? (Check parent functions, middleware, framework internals)
  • Is the sanitization method sufficient for this specific sink and context?
  • Does the framework provide implicit protection for this pattern?

Exploitability Check

  • Can the tainted value actually reach the sink in a form that triggers the vulnerability?
  • Is exploitation conditional on a specific environment, config, or privilege level?
  • For logic bugs: is the business impact real, or hypothetical?
  • Is the chosen tag the most precise valid label for this finding?

Judge Verdict

VerdictMeaningAction
CONFIRMEDAll reachability/sanitization/exploitability checks passInclude in report
LIKELYMost checks pass; one uncertainty remainsInclude in report, flag uncertainty
NEEDS CONTEXTCannot determine without runtime behavior / config / additional filesNote as "unverifiable without X"
FALSE POSITIVEA check definitively failsDrop silently

Only CONFIRMED and LIKELY findings are reported.

Judge Output Format (internal, before reporting)

Finding: VULN-NNN — <class>
Reachability:   PASS / FAIL / UNCERTAIN — <reason>
Sanitization:   PASS / FAIL / UNCERTAIN — <reason>
Exploitability: PASS / FAIL / UNCERTAIN — <reason>
Judge Verdict:  CONFIRMED / LIKELY / NEEDS CONTEXT / FALSE POSITIVE

False Positive Guardrails

  • Do not emit default_credentials unless there is a reachable authentication path that accepts a hardcoded, documented, factory, or seeded credential pair.
  • Do not emit weak_crypto_hash when the evidence only shows a vulnerable third-party component or a generic cryptography import. Require direct use of weak hashes, broken password storage, or unsafe signing.
  • Tag clarification: weak_crypto_hash is the canonical tag for both weak cryptographic algorithms (DES, RC4, ECB mode) and weak hash functions (MD5, SHA-1 for passwords). Do not use weak_crypto as a separate tag unless the benchmark ground truth explicitly requires it; prefer weak_crypto_hash to avoid tag fragmentation.
  • Do not emit generic rce when the code shows direct shell/process execution — prefer command_injection.
  • Do not replace spel_injection with command_injection or rce when the exploit primitive is Spring EL expression parsing.
  • Do not emit jndi_injection for component demos unless the JNDI sink itself is the primary exploit path.
  • Do not emit broad tags (trust_boundary, authentication, privilege_escalation) when a narrower precise tag is supported (xff_spoofing, session_fixation, verification_code).
  • Do not emit open_redirect for infrastructure/parser misconfiguration unless attacker-controlled redirect response is the primary exploit.
  • Do not emit denial_of_service merely because a path lacks size/rate limits — require explicit evidence that resource exhaustion is the primary impact.
  • Do not emit brute_force merely because a login endpoint lacks visible rate limiting — rate limiting may exist at infrastructure level. Require explicit evidence of unlimited attempt processing.
  • Do not emit csrf for stateless APIs using Bearer-token-only authentication with SessionCreationPolicy.STATELESS.
  • Do not emit insecure_deserialization when the same sink is already covered by component_vulnerability (e.g., Fastjson autoType) unless a separate deserialization path exists.
  • Do not emit arbitrary_file_upload for profile/avatar image upload with type restrictions and non-webroot storage.
  • Do not emit session_fixation when Spring Security default session management is active (migrateSession is the default).
  • Do not emit information_disclosure for database credentials in application config files — these are deployment issues, not application-level disclosure.

Step 6: Report Findings

Severity Classification

SeverityCriteria
CriticalDirect RCE, authentication bypass, unauthenticated data exposure
HighSQLi, SSRF, IDOR with sensitive data, stored XSS, privilege escalation
MediumReflected XSS, CSRF, path traversal, insecure deserialization
LowInformation disclosure, open redirect, weak crypto, insecure cookie
InfoMissing security headers, verbose errors, defense-in-depth gaps

Severity Downgrade Rule: When exploitation requires authentication, specific non-default configuration, chained prerequisites, or is only reachable through an internal/admin-only path, downgrade severity by one level from the class default; LIKELY-verdict findings whose exploitability is marked UNCERTAIN must be capped at one level below the class default regardless of vulnerability type.

Finding Format

[SEVERITY] VULN-NNN — <Vulnerability Class>  [CONFIRMED | LIKELY]
File: <path>:<line_number>
Description: <one sentence — what the vulnerability is>
Impact: <what an attacker can achieve>
Evidence:
  <relevant code snippet>
Judge: <one sentence — why this passed re-verification>
Remediation: <specific fix — not generic advice>
Reference: references/<vuln>.md

For NEEDS CONTEXT findings:

[UNVERIFIABLE] VULN-NNN — <Vulnerability Class>
File: <path>:<line_number>
Blocked by: <what additional context is needed>

Report Structure

When producing a full report, write to sast_report.md (or user-specified path):

# SAST Security Report — <target>
Date: <date>
Analyzer: llm-sast-scanner v1.3

## Executive Summary
<2-3 sentences: total findings by severity, most critical issue>

## Critical Findings
## High Findings
## Medium Findings
## Low Findings
## Informational
## Unverifiable Findings

## Remediation Priority
<ordered fix list>

Key Principles

  • Evidence over assertion: always show the vulnerable code path, not just the pattern name
  • Context matters: a finding is only valid if the sink is reachable with user-controlled data
  • Avoid false positives: if sanitization exists, verify it is bypassable before marking VULN
  • Be precise: include exact file paths and line numbers — never approximate
  • Fix > flag: always provide a concrete remediation, not just a problem statement
  • Language-aware: adapt sink/source patterns to the specific language and framework in use

Files

35 total
Select a file
Select a file to preview.

Comments

Loading comments…