hypnguyen1209/offensive-claude / skills/vulnerability-analysis
vulnerability-analysis
UnverifiedUse when auditing source code for vulnerabilities — drive CodeQL/Semgrep/Joern to taint untrusted data source-to-sink across injection, memory safety, deserialization/prototype-pollution, secrets/crypto/authz/race, and supply-chain risks
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 11.4 KB |
| references/deserialization-prototype-pollution.md | markdown | 8.3 KB |
| references/injection-source-patterns.md | markdown | 8.6 KB |
| references/memory-safety-c-cpp.md | markdown | 7.7 KB |
| references/secrets-crypto-authz-concurrency.md | markdown | 8.6 KB |
| references/supply-chain-dependency-audit.md | markdown | 7.3 KB |
| references/taint-engines-static-analysis.md | markdown | 11.0 KB |
| references/variant-hunting.md | markdown | 3.4 KB |
| scripts/dep_audit.py | script | 10.9 KB |
| scripts/deser_gadget_scan.py | script | 7.7 KB |
| scripts/evidence_kit.py | script | 13.0 KB |
| scripts/finding_dedup.py | script | 4.2 KB |
| scripts/joern_taint.sc | other | 3.6 KB |
| scripts/merge_runtime_evidence.py | script | 6.1 KB |
| scripts/path_conditions.py | script | 10.6 KB |
| scripts/provenance.py | script | 2.8 KB |
| scripts/sast_runner.py | script | 7.8 KB |
| scripts/secret_crypto_audit.py | script | 8.1 KB |
| scripts/taint_trace.py | script | 14.9 KB |
| scripts/validate_findings.py | script | 22.8 KB |
| scripts/variant_hunt.py | script | 11.8 KB |
| scripts/vocab_gate.py | script | 7.5 KB |
scripts/provenance.py
View on GitHub#!/usr/bin/env python3
"""provenance.py - per-hop provenance for a reachability path, and the "weakest hop" rule.
A source-to-sink / reachability path is a chain of hops. graphify's rule: how each hop was
established decides how much it can be trusted:
EXTRACTED - a literal, resolvable call/edge in the code (e.g. `foo()` where `foo` is defined and
the call site is a concrete `foo(` token). The strongest.
INFERRED - bridged by a name/resolver heuristic (dispatch table, duck-typed interface, a
same-name method picked across classes). Plausible, not proven.
AMBIGUOUS - an unresolved indirect edge (function pointer, reflection, dynamic import, vtable we
could not resolve). The weakest - could be wrong.
THE RULE: a path is only as strong as its WEAKEST hop. A CONFIRMED reachability claim requires an
all-EXTRACTED path; a single INFERRED hop caps the finding at POSSIBLE, and AMBIGUOUS is weaker
still. This is fail-CLOSED: an unknown/missing per-hop provenance is treated as AMBIGUOUS, never
silently upgraded. Post-hoc promotion of a hop's provenance is forbidden - the cap is computed from
the raw declared values and there is no code path that raises a hop's level.
"""
from __future__ import annotations
EXTRACTED = "EXTRACTED"
INFERRED = "INFERRED"
AMBIGUOUS = "AMBIGUOUS"
# higher = stronger. Anything unrecognized normalizes to the WEAKEST (AMBIGUOUS) - fail-closed.
_ORDER = {AMBIGUOUS: 0, INFERRED: 1, EXTRACTED: 2}
_LEVELS = (AMBIGUOUS, INFERRED, EXTRACTED)
def normalize(value) -> str:
"""Map any declared provenance to one of the three levels. Unknown/missing -> AMBIGUOUS."""
if isinstance(value, str):
v = value.strip().upper()
if v in _ORDER:
return v
return AMBIGUOUS
def rank(level: str) -> int:
return _ORDER[normalize(level)]
def _hop_provenance(hop) -> str:
if isinstance(hop, dict):
return normalize(hop.get("provenance"))
if isinstance(hop, str): # a bare hop string carries no provenance -> weakest
return AMBIGUOUS
return AMBIGUOUS
def weakest(hops) -> str:
"""The weakest provenance across all hops. An empty/absent path is AMBIGUOUS (a claimed
reachability with no hops is not proof). Fail-closed throughout."""
if not isinstance(hops, (list, tuple)) or len(hops) == 0:
return AMBIGUOUS
return min((_hop_provenance(h) for h in hops), key=_ORDER.__getitem__)
def all_extracted(hops) -> bool:
"""True iff the path is non-empty and every hop is EXTRACTED."""
if not isinstance(hops, (list, tuple)) or len(hops) == 0:
return False
return all(_hop_provenance(h) == EXTRACTED for h in hops)
def caps_to_possible(hops) -> bool:
"""A reachability path that is NOT all-EXTRACTED caps a CONFIRMED finding down to POSSIBLE."""
return not all_extracted(hops)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |