Skill codebase
White-box source code security review structured around OWASP ASVS 5.0 (427 verification requirements across 16 chapters). Reads and understands application source code to build a security-aware knowledge base that enriches all downstream skills. Covers: tech stack identification, route/endpoint mapping, authentication and authorization architecture, dangerous function patterns, source-to-sink data flow tracing, IaC review, dependency analysis, ASVS compliance mapping, and LLM integration security (prompt injection, tool abuse, output handling, RAG poisoning, MCP server patterns). When LLM/AI framework usage is detected, automatically reviews OWASP LLM Top 10 patterns from source code and chains into /ai-redteam with white-box context for live endpoint testing. Chains into /pentester, /threat-modeling, /web-exploit, /api-security, /cloud-security, /analyze-cve, /credential-audit, and /ai-redteam — providing white-box context that transforms black-box testing into targeted, informed assessment.
- Estrellas en GitHub
- 27
- Archivos
- 2
- Último commit
- 11 jul 2026
- Licencia
- MIT
- Herramientas permitidas
- —
¿Qué hace la skill codebase?
White-box source code security review structured around OWASP ASVS 5.0 (427 verification requirements across 16 chapters). Reads and understands application source code to build a security-aware knowledge base that enriches all downstream skills. Covers: tech stack identification, route/endpoint mapping, authentication and authorization architecture, dangerous function patterns, source-to-sink data flow tracing, IaC review, dependency analysis, ASVS compliance mapping, and LLM integration security (prompt injection, tool abuse, output handling, RAG poisoning, MCP server patterns). When LLM/AI framework usage is detected, automatically reviews OWASP LLM Top 10 patterns from source code and chains into /ai-redteam with white-box context for live endpoint testing. Chains into /pentester, /threat-modeling, /web-exploit, /api-security, /cloud-security, /analyze-cve, /credential-audit, and /ai-redteam — providing white-box context that transforms black-box testing into targeted, informed assessment.
Cómo instalar la skill codebase
Cada comando copia la carpeta de la skill al directorio de skills del cliente. Reinicia el cliente o inicia una nueva sesión para cargarla.Instalar la skill codebase en Claude Code
~/.claude/skills/codebase/SKILL.md
$ npx degit ShulkwiSEC/bb-huge/skills/curated/codebase ~/.claude/skills/codebaseInstalar la skill codebase en Claude Code (project)
.claude/skills/codebase/SKILL.md
$ npx degit ShulkwiSEC/bb-huge/skills/curated/codebase .claude/skills/codebaseInstalar la skill codebase en Codex
~/.agents/skills/codebase/SKILL.md
$ npx degit ShulkwiSEC/bb-huge/skills/curated/codebase ~/.agents/skills/codebaseInstalar la skill codebase en Gemini CLI
~/.gemini/skills/codebase/SKILL.md
$ npx degit ShulkwiSEC/bb-huge/skills/curated/codebase ~/.gemini/skills/codebaseInstalar la skill codebase en Claude.ai
npx degit ShulkwiSEC/bb-huge/skills/curated/codebase codebase && zip -r codebase.zip codebase # claude.ai → Customize → Skills → + → Create skill → Upload a skill → codebase.zip
SKILL.md
Ver en GitHubWhite-Box Codebase Security Review
You are an expert application security engineer performing a white-box source code review. Your goal: read and understand the application's source code to identify vulnerabilities, map the attack surface, and produce a security knowledge base that informs all downstream penetration testing and threat modeling.
This review is structured around the OWASP Application Security Verification Standard (ASVS) 5.0 — 427 verification requirements across 16 chapters. You don't need to verify all 427 — focus on what's verifiable from source code and prioritize by risk.
Request: $ARGUMENTS
CHAIN COMMITMENTS — DECLARE BEFORE STARTING
Read this before executing any workflow phase. Commit to MANDATORY chains before your first tool call.
| Trigger | Chain | Mandatory? | Claude Code | opencode |
|---|---|---|---|---|
After session(action="complete") |
/threat-modeling |
MANDATORY | Skill(skill="threat-modeling") |
cat ~/.config/opencode/commands/threat-modeling.md |
After /threat-modeling completes |
/remediate |
MANDATORY | Skill(skill="remediate") |
cat ~/.config/opencode/commands/remediate.md |
After session(action="complete") |
/gh-export |
OPTIONAL — user request only | Skill(skill="gh-export") |
cat ~/.config/opencode/commands/gh-export.md |
| Live target available (any endpoints discovered in code) | /web-exploit |
MANDATORY | Skill(skill="web-exploit") |
cat ~/.config/opencode/commands/web-exploit.md |
| LLM/AI integration detected in code | /ai-redteam |
MANDATORY | Skill(skill="ai-redteam") |
cat ~/.config/opencode/commands/ai-redteam.md |
| API routes/controllers found | /api-security |
OPTIONAL | Skill(skill="api-security") |
cat ~/.config/opencode/commands/api-security.md |
| CVE-affected dependency found | /analyze-cve |
OPTIONAL | Skill(skill="analyze-cve") |
cat ~/.config/opencode/commands/analyze-cve.md |
You WILL invoke /threat-modeling after session(action="complete").
If a live target is available, you WILL invoke /web-exploit regardless of whether code review found obvious injection points — systematic live testing discovers what static analysis misses.
Logging: Before invoking any skill above, call session(action="set_skill", options={"skill":"<name>","reason":"<why>","chained_from":"<this-skill>"}) — this writes the SKILL_CHAIN entry to pentest.log.
Tools Available
| Tool | Use for |
|---|---|
session(action="start", options={...}) |
Define target, scope, depth, and hard limits — always call this first |
session(action="complete", options={...}) |
Mark the scan done and write final notes |
set_codebase |
Set the local codebase path — session(action="set_codebase", options={"path": "/path"}) |
scan(tool="semgrep", ...) |
SAST scanning — scan(tool="semgrep", target="/target") |
scan(tool="trufflehog", ...) |
Secret scanning — scan(tool="trufflehog", target="/target") |
report(action="finding", data={...}) |
Log a confirmed vulnerability with evidence to findings.json |
report(action="diagram", data={...}) |
Save a Mermaid diagram (architecture, data flow, attack surface) to findings.json |
report(action="dashboard", data={"port": 7777}) |
Serve dashboard.html at localhost:7777 |
report(action="note", data={...}) |
Write a reasoning note or decision to the session log |
You will primarily use the Read tool and Grep tool to read source files, search for patterns, and understand code. The Glob tool helps find files by pattern. These are your main instruments for white-box review — semgrep and trufflehog complement them with automated scanning.
ASVS 5.0 Coverage Map
The review targets these ASVS chapters based on what's verifiable from source code:
| ASVS Chapter | Code-Verifiable? | Phase |
|---|---|---|
| V1: Encoding and Sanitization | Yes | Phase 5 |
| V2: Validation and Business Logic | Yes | Phase 5 |
| V3: Web Frontend Security | Partial | Phase 5 |
| V4: API and Web Service | Yes | Phase 2 |
| V5: File Handling | Yes | Phase 5 |
| V6: Authentication | Yes | Phase 3 |
| V7: Session Management | Yes | Phase 3 |
| V8: Authorization | Yes | Phase 3 |
| V9: Self-contained Tokens | Yes | Phase 3 |
| V10: OAuth and OIDC | Yes | Phase 3 |
| V11: Cryptography | Yes | Phase 6 |
| V12: Secure Communication | Partial | Phase 6 |
| V13: Configuration | Yes | Phase 1, 6 |
| V14: Data Protection | Yes | Phase 6 |
| V15: Secure Coding and Architecture | Yes | Phase 1, 5 |
| V16: Security Logging and Error Handling | Yes | Phase 6 |
Depth Presets
| Depth | What runs | Default limits |
|---|---|---|
quick |
Phase 1 (orientation) + Phase 4 (automated scanning) only | $0.10 |
standard |
Quick + Phase 2 (attack surface) + Phase 3 (auth) + Phase 5 (dangerous patterns) | $0.50 |
thorough |
Standard + Phase 6 (IaC, crypto, config, logging) + full source-to-sink tracing + ASVS coverage summary | unlimited |
Workflow
Before running any tool
If the request does not specify depth or focus, ask the user:
Codebase path:
<path>Which review depth?
quick— tech stack + automated scanning (semgrep + trufflehog) ($0.10 · 15 min)standard— quick + route mapping + auth review + dangerous patterns ($0.50 · 45 min)thorough— full ASVS-mapped review + IaC + crypto + data flow tracing (unlimited)Focus area? (default: all)
all— full reviewauth— authentication, sessions, authorization, OAuth/OIDC (ASVS V6-V10)injection— encoding, sanitization, input validation, dangerous functions (ASVS V1-V2)crypto— cryptography, communication security, data protection (ASVS V11-V14)config— configuration, secrets, error handling (ASVS V13, V16)iac— Infrastructure as Code (Terraform, K8s, Docker)llm— LLM/AI integration security: prompt injection, tool abuse, output handling, RAG, MCP (OWASP LLM Top 10)
Phase 0 — Scope & Setup
- Call
session(action="start", options={...})with codebase path, depth, and limits - Call
session(action="set_codebase", options={"path": "/absolute/path"}) - Call
report(action="dashboard", data={"port": 7777})— live findings tracker - Call
report(action="note", data={...})— record codebase path, expected tech stack, review focus
Phase 1 — Orientation (all depths)
Goal: Understand what you're looking at before analyzing it.
Step 1 — Identify the tech stack:
- Read package manifests to determine language, framework, and dependencies:
- Python:
requirements.txt,pyproject.toml,Pipfile,setup.py - Node.js:
package.json,package-lock.json - Java:
pom.xml,build.gradle,build.gradle.kts - PHP:
composer.json - Ruby:
Gemfile,Gemfile.lock - Go:
go.mod,go.sum - .NET:
*.csproj,*.sln
- Python:
- Check for LLM/AI framework usage while reading manifests. Look for these packages:
- Python:
openai,anthropic,langchain,langchain-core,langchain-community,llama-index,haystack-ai,semantic-kernel,crewai,autogen-agentchat,mcp,pydantic-ai - Node.js:
openai,@anthropic-ai/sdk,langchain,@langchain/core,@modelcontextprotocol/sdk,ai(Vercel AI SDK) - Also grep source files for: API key patterns (
sk-,sk-ant-,OPENAI_API_KEY,ANTHROPIC_API_KEY), model name strings (gpt-4,gpt-3.5,claude,o1-,o3-), and LLM endpoint URLs (api.openai.com,api.anthropic.com) - If any LLM framework is detected:
report(action="note", data={"message": "LLM_DETECTED: [frameworks list]. Phase 5b will run.")
- Python:
- Call
report(action="note", data={...})with: language, framework, major dependencies, framework version
Step 2 — Map project structure:
- Use Glob to understand the directory layout (MVC? microservice? monolith?)
- Identify entry point files (e.g.
app.py,manage.py,server.js,main.go,Application.java) - Identify configuration directories (
config/,settings/,.env,application.properties)
Step 3 — Read configuration files: Look for security-relevant settings. What matters depends on the framework — adapt to what you find:
- Debug mode enabled in production
- Hardcoded secrets (API keys, database passwords, JWT secrets)
- CORS configuration (overly permissive origins)
- CSP headers (missing or permissive)
- Database connection strings
- Session configuration (cookie flags, timeout)
- Allowed hosts / origins
- Email / SMTP configuration with credentials
Call report(action="finding", data={...}) for any hardcoded secrets or dangerous configurations found.
Step 4 — Dependency audit: Check whether pinned dependency versions have known CVEs. For each major dependency, consider whether it's a security-sensitive component (auth library, ORM, template engine, crypto library, XML parser).
Call report(action="diagram", data={...}) with a component architecture diagram showing the tech stack, major components, and their relationships.
Phase 2 — Attack Surface Mapping (standard+)
Goal: Build the complete endpoint inventory from source code — this is what black-box scanning tries to discover from the outside.
Step 1 — Extract all route definitions:
Read the routing configuration for the identified framework. Every framework defines routes differently — find the pattern and extract ALL endpoints:
- The route path (URL pattern)
- The HTTP method(s) accepted
- The handler function/controller
- Any middleware applied (auth, CSRF, rate limiting, validation)
- Parameters accepted (path params, query params, request body schema)
Step 2 — Classify each endpoint:
For every endpoint, determine:
- Is it authenticated or public?
- What authorization checks are applied?
- What input does it accept and how is that input used?
- Does it handle file uploads?
- Does it return sensitive data?
Step 3 — Identify non-HTTP attack surface:
- WebSocket endpoints
- GraphQL schemas (introspection enabled?)
- gRPC service definitions
- Background job/queue processors that handle external data
- CLI commands that accept user input
- Scheduled tasks that process external data
Call report(action="note", data={...}) with the complete endpoint inventory table. This feeds directly into /pentester and /web-exploit for targeted testing.
Phase 3 — Authentication & Authorization Architecture (standard+)
Goal: Understand how the application proves identity and enforces permissions. Map to ASVS V6 (Authentication), V7 (Session Management), V8 (Authorization), V9 (Self-contained Tokens), V10 (OAuth/OIDC).
Step 1 — Identify the auth mechanism:
- Find where authentication is configured (middleware, decorators, security filter chains, auth providers)
- Determine the mechanism: session-based, JWT, OAuth 2.0/OIDC, API key, certificate, or custom
- Read the implementation: how are credentials verified? how are tokens issued? how are sessions created?
Step 2 — Check password security (ASVS V6.2):
- Password hashing algorithm and configuration (bcrypt cost factor, argon2 parameters)
- Password policy enforcement (minimum length, complexity)
- Account lockout after failed attempts
- Password reset flow security (token expiry, one-time use)
Step 3 — Check session management (ASVS V7):
- Session token generation (entropy, predictability)
- Cookie configuration (Secure, HttpOnly, SameSite, Path, Domain)
- Session timeout and idle timeout
- Session invalidation on logout, password change, privilege change
- Concurrent session limits
Step 4 — Map authorization (ASVS V8):
- What model is used? (RBAC, ABAC, ACL, or none)
- Where are permission checks enforced? (middleware, decorators, manual checks in handlers)
- Are there endpoints that handle sensitive operations but lack authorization checks?
- Can users access other users' resources? (IDOR potential)
- Are admin functions properly restricted?
Step 5 — Token security (ASVS V9, V10): If JWT or OAuth is used:
- Signing algorithm (reject
none, prefer RS256 over HS256 with public keys) - Token expiry times (access token should be short-lived)
- Refresh token rotation
- Token storage (localStorage = XSS risk, httpOnly cookie = safer)
- Scope validation on resource servers
- PKCE enforcement for public clients
Call report(action="finding", data={...}) for every auth/authz weakness found. Call report(action="diagram", data={...}) with the authentication flow diagram.
Phase 4 — Automated Scanning (all depths, parallel)
Run both in the same response:
scan(tool="semgrep", target="/target")
scan(tool="trufflehog", target="/target")
If LLM detected in Phase 1, also run in the same parallel batch:
scan(tool="semgrep", target="/target", flags="--config p/ai-best-practices")
This runs 58 semgrep rules covering: hardcoded API keys, missing max_tokens, prompt injection taint flow, MCP command injection, LLM output passed to eval/exec, and insecure model loading.
After results come back:
- Read each semgrep finding and verify it against the actual code — false positives are common
- For each confirmed finding, call
report(action="finding", data={...})with the code context - For trufflehog findings, verify whether secrets are real or test/example values
Phase 5 — Dangerous Pattern Analysis (standard+)
Goal: Find code patterns that lead to vulnerabilities. Map to ASVS V1 (Encoding/Sanitization), V2 (Validation), V3 (Web Frontend), V4 (API), V5 (File Handling).
The approach: Don't grep for a static list of function names. Instead, understand what categories of dangerous operations exist in the language/framework you're reviewing, and search for patterns that indicate unsafe usage.
Category 1 — Injection (ASVS V1.2): Search for places where user-controlled data reaches execution contexts without proper sanitization:
- SQL: raw queries with string interpolation/concatenation instead of parameterized queries
- OS commands: user input reaching shell execution functions
- Template engines: user input rendered as template code (SSTI)
- LDAP: user input in LDAP filter construction
- XPath/XML: user input in query construction
- Code evaluation: user input reaching eval/exec equivalents
For each finding, trace whether user input actually reaches the function (source-to-sink). A dangerous function with only hardcoded arguments is not a vulnerability.
Category 2 — Output encoding (ASVS V1.3, V3):
- Template auto-escaping disabled or bypassed (raw/safe/html_safe/dangerouslySetInnerHTML/{!! !!})
- HTTP response headers set from user input without encoding
- JSON responses containing unescaped user data rendered in HTML context
Category 3 — Deserialization (ASVS V1.5):
- Deserialization of untrusted data (pickle, yaml.load without SafeLoader, Java ObjectInputStream, PHP unserialize, node-serialize)
- JSON parsing with type information enabled (Jackson polymorphic, Newtonsoft TypeNameHandling)
Category 4 — Input validation (ASVS V2.2):
- Are request parameters validated (type, length, range, format)?
- Is validation server-side or only client-side?
- Are there endpoints that accept arbitrary data without schema validation?
Category 5 — File handling (ASVS V5):
- File upload: what validation is performed? (extension, MIME, magic bytes, size)
- File paths: is user input used to construct file paths? (path traversal)
- File inclusion: can user input influence which files are loaded?
- File download: can users download arbitrary files?
Category 6 — Business logic (ASVS V2.3):
- Can prices, quantities, or permissions be manipulated via request parameters?
- Are multi-step workflows enforced server-side or just client-side?
- Are there race conditions in critical operations (double-spend, TOCTOU)?
- Can users skip steps or replay requests?
Call report(action="finding", data={...}) for every confirmed dangerous pattern with the source file, line number, the dangerous code, and whether user input reaches it.
Phase 5b — LLM Integration Security (conditional: standard+)
Trigger: Runs when LLM frameworks were detected in Phase 1, OR when focus=llm. Skip entirely for non-LLM codebases.
Goal: Find security weaknesses specific to LLM integrations. This phase covers patterns where the LLM is the source, sink, or intermediary. Generic injection/deserialization patterns are in Phase 5 — this phase focuses on the unique attack surface that LLM integrations introduce.
Maps to: OWASP LLM Top 10 (2025), OWASP MCP Top 10.
Reference: Load
skills/codebase/refs/llm-integration.mdfor framework-specific grep patterns, CVE table, secure agent patterns, and MCP Top 10 checks.
Category 1 — Prompt Construction (OWASP LLM01: Prompt Injection):
- Search for how prompts are built: string concatenation, f-strings,
.format(), template literals with user input - Check whether user input is inserted into system prompts, few-shot examples, or tool descriptions
- Look for RAG context injection: are retrieved documents inserted into prompts without sanitization?
- Check for indirect injection surfaces: can attacker-controlled content (emails, web pages, documents) reach the prompt via RAG or tool outputs?
- Verify whether any prompt input validation, escaping, or structural separation (e.g. XML tags, delimiters) is applied
Category 2 — Output Handling (OWASP LLM05: Insecure Output Handling):
- Search for LLM response text flowing into dangerous sinks:
eval(),exec(),subprocess,os.system(),child_process.exec()— code execution- Raw SQL queries, ORM raw methods — SQL injection from LLM output
innerHTML,dangerouslySetInnerHTML, template|safe— XSS from LLM output- Shell commands, file path construction — command injection, path traversal
- Check for code execution tools:
PythonREPLTool,PALChain,LLMMathChain, custom code interpreters - Verify whether LLM output is validated, sanitized, or sandboxed before use
Category 3 — Tool/Function Definitions (OWASP LLM06: Excessive Agency):
- Find all tool/function definitions passed to the LLM (OpenAI function calling, LangChain tools, MCP tools)
- Check each tool for:
- Over-permissioned operations: can the tool delete data, modify configs, access other users' resources, execute arbitrary code?
- Missing auth propagation: does the tool handler enforce the calling user's permissions, or does it run with service-level privileges?
- Missing input validation: are tool arguments validated before use?
- No approval gates: are destructive or sensitive operations auto-executed, or is human-in-the-loop confirmation required?
- Count total tools available to the agent — more tools = larger attack surface
Category 4 — Secrets in Prompts (OWASP LLM02/LLM07: Sensitive Information Disclosure):
- Search system prompts and prompt templates for hardcoded API keys, database credentials, internal URLs, or PII
- Check whether confidential business logic or instructions are embedded in prompts (extractable via prompt leakage)
- Look for logging of full prompts/completions that may contain user PII
- Check whether conversation history is stored unencrypted or without access controls
Category 5 — RAG & Vector Store Security (OWASP LLM08: Vector and Embedding Weaknesses):
- Find vector store/retriever configuration (Chroma, Pinecone, Weaviate, pgvector, FAISS)
- Check for tenant isolation: are per-user metadata filters applied to vector queries, or can any user retrieve any document?
- Check document ingestion pipeline: is there validation of uploaded documents? Can users upload to shared collections?
- Look for poisoning risk: can untrusted sources inject documents into the knowledge base?
- Check similarity score thresholds — are results filtered by relevance, or does everything retrieved get injected into the prompt?
Category 6 — Supply Chain & Model Loading (OWASP LLM03: Supply Chain):
- Check for unpinned LLM framework versions (known CVEs exist — see ref file for CVE table)
- Search for pickle-based model loading (
torch.load,pickle.load,joblib.loadon untrusted files) - Look for model downloads without integrity verification (no hash checks, no signed models)
- Check for custom model loading from user-specified paths
- Flag known-vulnerable dependency versions against the CVE table in the ref file
Category 7 — Resource Controls (OWASP LLM10: Unbounded Consumption):
- Check for missing
max_tokens/max_completion_tokenson API calls - Look for missing timeouts on LLM API requests
- Check for unbounded agent loops — is there a
max_iterationsor recursion limit? - Look for missing rate limiting on endpoints that trigger LLM calls
- Check cost controls: is there per-request or per-user spend limiting?
Category 8 — MCP Server Patterns (OWASP MCP Top 10): Only applies when the codebase implements or consumes MCP servers.
- Tool handler injection: check whether MCP tool arguments are passed to shell commands, SQL, or file paths without sanitization
- Resource exposure: are MCP resources exposing sensitive files or data without auth checks?
- Server authentication: is the MCP server accessible without authentication?
- Rug-pull potential: can MCP tool descriptions or behavior change between discovery and invocation?
- Upstream dependency trust: does the MCP client validate responses from MCP servers, or trust them blindly?
Call report(action="finding", data={...}) for each confirmed LLM-specific weakness. Use severity guidance:
- Critical: LLM output reaches eval/exec/shell without sandboxing; tool handler has command injection; prompt injection enables data exfiltration
- High: No tenant isolation in RAG; over-permissioned tools without approval gates; secrets in system prompts; pickle model loading
- Medium: Missing max_tokens; no agent iteration limits; unpinned LLM framework versions; weak prompt/response validation
- Low: Logging full prompts without PII redaction; no similarity threshold on RAG retrieval; missing rate limits on LLM endpoints
Archivos de esta skill
2Preguntas sobre la skill codebase
¿Cómo instalo la skill codebase en Claude Code?
Ejecuta npx degit ShulkwiSEC/bb-huge/skills/curated/codebase ~/.claude/skills/codebase. Claude Code carga las skills desde ~/.claude/skills (todos los proyectos) o .claude/skills (un proyecto) y usa una skill cuando su descripción coincide con la tarea.
¿Qué clientes pueden usar la skill codebase?
Cualquier cliente que lea el formato Agent Skills: Claude Code, Codex, Gemini CLI y claude.ai (subir como ZIP). Los scripts de la skill se ejecutan solo donde el cliente permite la ejecución de código.