vulnerability-analysis

Expert-level security vulnerability analysis for source code auditing. Use this skill when reviewing code for security vulnerabilities, performing security audits, analyzing attack surfaces, hunting for injection flaws, assessing authentication and authorization logic, evaluating cryptographic implementations, identifying memory safety issues, checking for race conditions, reviewing dependency security, or hardening web APIs and infrastructure code.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "vulnerability-analysis" with this command: npx skills add kylejryan/better-code/kylejryan-better-code-vulnerability-analysis

Vulnerability Analysis

Every vulnerability you miss is a vulnerability an attacker can find. Systematic analysis traces untrusted data from source to sink, evaluates filters for bypass, and questions every trust boundary assumption.

When to Apply

Apply this analysis when:

  • Reviewing any code for security vulnerabilities
  • Auditing authentication, authorization, or session logic
  • Evaluating input handling and output encoding
  • Assessing cryptographic implementations
  • Reviewing file operations, command execution, or deserialization
  • Checking for race conditions in concurrent code
  • Analyzing dependency security and supply chain risks
  • Hardening web APIs, reverse proxies, or infrastructure code

Core Methodology

Taint Analysis: Mark untrusted data at its origin (source) and track propagation to dangerous operations (sink). Assess whether adequate sanitization exists along each path.

Source-Forward: Start from data entry points, trace every path through the codebase to sinks. Comprehensive but time-consuming.

Sink-Backward: Start from dangerous operations (eval, exec, SQL, innerHTML), trace backward to potential sources. Faster and targeted.

Hybrid Approach: Use sink-backward for rapid high-risk identification, then source-forward for complete coverage of the attack surface.

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Taint AnalysisCRITICALtaint-
2Memory SafetyCRITICALmemory-
3Injection AttacksCRITICALinjection-
4Authentication & AuthorizationHIGHauth-
5Cryptographic VulnerabilitiesHIGHcrypto-
6Concurrency & Race ConditionsHIGHconcurrency-
7Web & API SecurityMEDIUM-HIGHweb-
8Supply Chain & DependenciesMEDIUMsupply-

Audit Protocol

  1. Reconnaissance: Identify language, frameworks, trust boundaries, sensitive data, and high-value targets. Establish the threat model — what attacker capabilities are assumed?
  2. Attack Surface Enumeration: Map all entry points — HTTP endpoints, CLI args, file inputs, IPC, deserialization points
  3. Systematic Analysis: Apply hybrid taint analysis across all source-sink paths
  4. False Positive Reduction: For every finding, verify: (a) trace validation chains upstream — is the value bounded before reaching the sink? (b) confirm reachability — can an attacker actually trigger this path from external input? (c) evaluate against the project's threat model — does exploitation require capabilities the attacker isn't assumed to have? (d) check for established patterns — is this a recognized safe idiom in the domain (e.g., volatile+fences in VMMs, privileged setup phases in sandboxes)?
  5. Exploitability Gate: Before reporting ANY finding, answer all three questions affirmatively: (a) Are you certain this isn't the expected functionality? (b) Is this a valid vulnerability worth reporting? (c) Is it actually exploitable to users with this deployed in production? If any answer is "no" or uncertain, investigate further — read the actual code paths and verify before claiming exploitability.
  6. Findings: Document CWE, severity, root cause, exploitation scenario, and remediation. Rate severity based on actual exploitability after the Exploitability Gate, not pattern-match severity.
  7. Variant Hunting: Generalize each finding into a pattern and search for variants

How to Use

Read individual reference files for detailed vulnerability patterns and code examples:

references/taint-source-sink-analysis.md
references/injection-sql.md
references/injection-command.md
references/auth-bypass.md
references/crypto-weak-algorithms.md
references/_sections.md

Each reference file contains:

  • Explanation of the vulnerability class and why it matters
  • Vulnerable code example with exploitation scenario
  • Secure code example with explanation
  • Language-specific patterns and edge cases

False Positive Discipline

A finding without confirmed exploitability is noise. Before reporting any vulnerability:

  • Trace the full validation chain: Follow the value backward from sink to source. If it's bounded, cast, or validated upstream, the overflow/injection may be impossible regardless of the sink pattern.
  • Verify attacker reachability: Can external input actually reach this code path? Internal invariant assertions (.unwrap() after bounds checks) are not guest/user-triggerable vulnerabilities.
  • Respect the threat model: A jailer running as root needs root. A snapshot loaded from a chroot is trusted by design. Flag design-level concerns separately from exploitable vulnerabilities.
  • Recognize domain idioms: volatile + memory fences is the standard virtio/VMM pattern, not a race condition. Privileged setup before exec() is the standard sandbox pattern, not a privilege escalation.
  • Separate severity from pattern: An unchecked_mul on a value bounded to 256 is not CRITICAL. Rate by actual exploitability, not by the CWE description.

Security Review Checklist

After reviewing code, verify:

  • All user inputs are validated server-side with allowlists
  • Database queries use parameterized statements exclusively
  • Command execution avoids shell interpretation
  • Output encoding matches the rendering context (HTML, JS, CSS, URL)
  • Authentication checks exist on every sensitive endpoint
  • Authorization verifies ownership, not just authentication
  • Cryptographic operations use modern algorithms with proper key management
  • Session tokens have sufficient entropy with Secure, HttpOnly, SameSite attributes
  • File operations validate paths against traversal attacks
  • Deserialization never operates on untrusted data without safe loaders
  • Race conditions are mitigated with atomic operations or proper locking
  • Dependencies are pinned, audited, and free of known CVEs

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Security

seo-assistant

A client-facing SEO assistant grounded in Google's official SEO Starter Guide. Use this skill whenever a user mentions SEO, search rankings, Google visibility, meta descriptions, title tags, page titles, alt text, sitemaps, duplicate content, URL structure, or asks how to improve their website's presence in search results. Also trigger when a user shares a URL or webpage content and wants feedback, or asks for help writing any web content that needs to perform well in search. This skill covers auditing, content writing, and answering SEO questions — use it proactively even if the user only hints at wanting more website traffic or better Google rankings.

Archived SourceRecently Updated
Security

skillguard-hardened

Security guard for OpenClaw skills, developed and maintained by rose北港(小红帽 / 猫猫帽帽). Audits installed or incoming skills with local rules plus Zenmux AI intent review, then recommends pass, warn, block, or quarantine.

Archived SourceRecently Updated
Security

memory-poison-auditor

Audits OpenClaw memory files for injected instructions, brand bias, hidden steering, and memory poisoning patterns. Use when reviewing MEMORY.md, daily memory files, or any long-term memory store that may have been contaminated through dialogue.

Archived SourceRecently Updated
Security

BlogBurst - Virtual CMO Agent

Your AI Chief Marketing Officer. Autonomous agent that runs your entire marketing — auto-posts to Twitter/X, Bluesky, Telegram, Discord, auto-engages with your audience (replies, likes, follows), runs SEO/GEO audits, tracks competitors, scans communities for opportunities, learns what works, and continuously optimizes. 50+ countries, 1000+ posts published. Free tier available.

Archived SourceRecently Updated