plugins/oh-my-secuaudit/skills/sec-reference-retrieval/SKILL.md
Query multi-source AppSec catalogs (CWE / OWASP Cheat Sheet Series / GitHub Advisory Database / AppSec.fyi) for a given security finding and propose a synthesis row to the security-field-notes synthesis-ledger via PR. Use when a producer skill (sec-audit-static, sec-audit-dast, external-software-analysis) emits a finding that needs external reference enrichment, or when packaging an assessment finding for downstream remediation context.
npx skillsauth add windshock/oh-my-secuaudit sec-reference-retrievalInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Given a security finding (typically from a producer skill), query four upstream AppSec catalogs in parallel, distill the matches into a single dense synthesis, and propose a row to the security-field-notes synthesis ledger via PR. The skill is the pull-side counterpart to the push-side workflow in security-architecture-review — it brings external context IN, while SAR pushes findings OUT to remediation.
A finding without external reference is a hypothesis. A finding with reconciled multi-source synthesis is a contract surface.
The skill does not produce knowledge of its own — it retrieves what already exists (CWE / OWASP / GHSA / AppSec.fyi), distills it into a reusable row, and submits it through the §14 PR-reviewed staging layer so future LLMs can read the row instead of re-running the same retrieval.
This skill is being built in narrow slices. Current covered:
SSRF (slice 1) + XSS (slice 2). Other categories deferred to slice 3+.security-field-notes updates are human-opened PRs (auto-PR is slice 3+, intentionally delayed until ledger row shape stabilizes across multiple categories).templates/ledger-row.md; the dry-run output for each new row explicitly records its stale-check verdict against prior ledger rows. Automated enforcement is deferred (slice 3+).Tracking: issue #7.
sec-audit-static, sec-audit-dast, external-software-analysis) emits a finding whose category matches an entry in references/cwe-mapping.mdsecurity-testing-as-code and external reference context is needed for the PoC narrativesecurity-architecture-review synthesizer needs reconciled external context for an attack scenario (manual invocation)category — the finding's category string (e.g., "SSRF", "XSS", "deserialization"). Slices 1+2 support SSRF and XSS.evidence_summary — short text describing the candidate (e.g., "Image proxy endpoint follows redirect without validating destination host"). Used only for synthesis context; never echoed into the ledger row verbatim (scrub guard).security-field-notes/knowledge/appsec/synthesis-ledger.md schemawindshock/security-field-notesreferences/cwe-mapping.md.category. If not present in slice 1's mapping, stop and report category-not-supported.primary_cwe (e.g., CWE-918 for SSRF) and related_cwes (e.g., CWE-601, CWE-441).Read references/source-catalog.md for per-source fetch verbs. Execute the four fetches in parallel:
GitHub Advisory Database (GHSA):
The GHSA REST endpoint accepts cwes as the numeric CWE ID only (e.g., 918, 79). The CWE- prefix MUST be stripped before the API call — cwes=CWE-918 silently returns zero results (confirmed against the live API 2026-05-22). The skill's representation of CWE elsewhere (Evidence refs, ledger row, SKILL.md prose) keeps the CWE-NNN form; only the GHSA query strips the prefix.
PRIMARY_CWE_NUM="${PRIMARY_CWE#CWE-}" # e.g., CWE-918 → 918
gh api "/advisories?cwes=${PRIMARY_CWE_NUM}&per_page=20&sort=updated"
Filter results to advisories with both a patch commit reference and a CVSS score. If the advisory text does not link a patch commit directly, recover it via gh api /repos/<owner>/<repo>/commits?path=<vulnerable-file> against the upstream repo (this was the slice-2 NocoDB workflow — the GHSA page didn't link the patch commit). Skip any advisory whose ghsa_id already appears in security-field-notes/knowledge/appsec/synthesis-ledger.md (check the live file at runtime, not a snapshot).
CWE canonical definition: WebFetch https://cwe.mitre.org/data/definitions/<NNN>.html. Use primary_cwe only; related CWEs need not be fetched unless synthesis ambiguity arises.
OWASP Cheat Sheet Series: WebFetch the relevant cheat sheet at the URL specified per category in source-catalog.md.
AppSec.fyi: WebFetch the relevant topic page (https://www.appsec.fyi/<topic>.html). If the page does not exist or has no relevant content for the candidate, record the miss explicitly in the Sources matched cell of the row (Axios precedent — see existing ledger row 2026-05-21 Axios NO_PROXY).
If any source rate-limits or returns 5xx, retry once with exponential backoff. If still failing, record the source as (unavailable at retrieval time) in Sources matched and proceed.
Before composing the new row, perform an explicit stale check against the existing ledger. The check is documented and run by the assessor; it is NOT yet automated (automation is deferred to slice 3+).
Procedure:
synthesis-ledger.md whose Finding pattern or CWE(s) is related to the current candidate. Two rows are "related" when:
Last verified date:
Synthesis:
Stale Guard check: 4 SSRF-family rows examined (Next.js / Axios / GHE / Coder, all Last verified 2026-05-21 — fresh); no stale citations used in this run.If there are zero related rows, record Stale Guard check: no prior related rows in ledger.
Distill the four (or fewer, on misses) source outputs into a single dense synthesis cell that follows the quality bar set by the 3 backfill rows in synthesis-ledger.md:
GHSA-c4j6-fc7j-m34r)c4f69086)≥13.4.13, <15.5.16 + ≥16.0.0, <16.2.5)CVSS 8.6)Use templates/ledger-row.md to fill all 8 columns:
Date: today (ISO YYYY-MM-DD)Finding pattern: short noun phrase describing the vulnerability class (scrubbed of internal identifiers)CWE(s): primary_cwe; related_cwes if both contributeSources matched: list each source that hit. Misses recorded as (<Source> 직접 hit 없음) per Axios precedentEvidence refs: GHSA-id; commit:<short_sha>; OWASP cheat sheet name; CWE-NNN — semicolon-separatedSynthesis: the Phase 3 cellUsed in: retrieval test (sec-reference-retrieval PoC slice <N>) where <N> is the current sliceLast verified: today (ISO)Scrub pass (LLM-driven in slice 1, PR review is the §14 gate):
evidence_summary contains any of the above, redact in the synthesisOpen PR-B against windshock/security-field-notes:
ledger/<category-lowercase>-<ghsa-short> (e.g., ledger/ssrf-c4j6fc7j)ledger: add <category-uppercase> retrieval row for <ghsa_id>The skill is bound by security-field-notes/AGENTS.md §14. These rules govern every run:
security-field-notes maintainers graduate rows to knowledge/appsec/<topic>.md after ≥3 hits. The skill MAY append a new finding pattern to ## Promotion Status at 1 hit, but MUST NOT increment hit counts on existing patterns or trigger graduation (those are human-curated decisions).Sources matched and Evidence refs cells are never empty (recording a miss as (직접 hit 없음) still counts as filled)Used in cell anchors it to a session, preserving the staging-layer framingsecurity-field-notesA run is considered successful when:
category resolves through references/cwe-mapping.md to a non-empty CWE listwindshock/security-field-notes with Used in = retrieval test (sec-reference-retrieval PoC slice <N>)category not in cwe-mapping.md: stop and report. Adding the mapping is a separate PR.Sources matched filled with at least one real hit, not just misses).evidence_summary may need redaction at the producer side.references/source-catalog.md — per-source fetch verb + Evidence-refs token formatreferences/cwe-mapping.md — category → CWE lookuptemplates/ledger-row.md — 8-column ledger row template + scrub checklist + calibration examplessecurity-field-notes/AGENTS.md §14 — Pull-Side Synthesis Ledger Protocol (the governance contract this skill implements)security-field-notes/knowledge/appsec/synthesis-ledger.md — calibration anchor; the 3 backfill rows define the quality barsecurity-field-notes/knowledge/appsec/2026-05-20-appsec-fyi-curation-library-survey.md — multi-source design backgroundoh-my-secuaudit Issue #7 — PoC trackingsecurity-field-notes Issue #1 — push/pull catalog adoptiondevelopment
Transform security assessment deliverables from static documents (Word/Excel/portal) into version-controlled, executable projects. PoCs replace narrative claims; saved HTTP requests replace checkboxes; commit hashes enable exact-state reproduction. Use when scoping methodology for an audit, when an existing assessment needs to be made reproducible, or when assessment outputs must be inheritable across teams.
development
Security architecture review for codebases, producing Data Flow Diagram (DFD) with trust boundaries, Attack Flow overlay, scoped attack surface inventory, sensitive data map, and risk summary grounded in code. Use when asked to perform architecture-focused security review, reconstruct security design from code, or produce DFD/attack-flow documentation.
development
Dataflow-based code clustering for security assessments. Groups (Endpoint, Sink) paths by shared review strategy so reviewers sample representative cases instead of exhaustively reviewing every path. Use when scoping manual review on a codebase with 50+ endpoints, repetitive sanitization patterns, or after initial SAST/SCA produces large finding sets that need triage.
development
Static code security audit playbook (SAST, SCA, secret detection) with standardized JSON outputs and reporting. Use for source-code based assessments, schema validation, and generating final reports.