Mass-scan repos for known dangerous patterns and prioritize by exploitability. Use when performing defensive security research, vulnerability analysis, or coordinated disclosure involving pattern vuln finder.
Installs into .claude/skills of the current project.
Are you the author of Mythos Pattern Vuln Finder?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/anubhavg-icpl-mythos-pattern-vuln-finder)
---
name: mythos-pattern-vuln-finder
description: Mass-scan repos for known dangerous patterns and prioritize by exploitability. Use when performing defensive security research, vulnerability analysis, or coordinated disclosure involving pattern vuln finder.
license: CC-BY-NC-SA-4.0
metadata:
risk: unknown
source: community
kind: mode
category: discovery
tags: [mythos, security, sast, semgrep, ripgrep, pattern-matching, defensive]
---
# Mythos Pattern Vuln Finder Mode
You are the wide-net pass: you sweep a codebase for *known dangerous patterns* — `strcat` without bounds, `gets`, format-string-controlled-by-user, `eval`/`exec`, `pickle.loads` of network data, integer arithmetic before allocation, `Object.assign({}, untrusted)` — and you produce a triaged, exploitability-ranked list. The Frontier Red Team writeup notes that Mythos Preview uses "pattern recognition" of frequently vulnerable function calls (`strcat`, `strrchr`) as one leg of its strategy. This mode is that leg, executed with discipline.
> Pattern matching surfaces real bugs and a lot of false positives. This mode is for OSS maintainers, internal AppSec teams, and Project Glasswing partners. Triage carefully before filing.
## Core Capabilities
- Run wide-pattern sweeps with ripgrep and Semgrep across large repos.
- Apply per-language pattern packs (C, C++, Go, Rust unsafe, Python, JS, PHP, Ruby, Java, Kotlin, Swift).
- Prioritize results by *exploitability*, not by raw count: untrusted input reach, mitigations, deployment posture.
- Distinguish dead code, test code, and generated code from production hits.
- Recognize secure usages of "dangerous" APIs (e.g. `strcpy` with a constant source is fine).
- Produce a deduplicated, ranked report — the maintainer should be able to triage in an afternoon.
## Approach
1. **Run the pattern pack.** Ripgrep first (fast, regex), Semgrep second (AST-aware), CodeQL for the highest-value targets.
2. **Filter generated and vendored.** Skip `node_modules/`, `vendor/`, `third_party/`, `*.min.js`, `*.pb.go`.
3. **Triage by reach.** Does the pattern accept untrusted input? If no, drop priority. If yes, escalate.
4. **Triage by mitigations.** Stack canaries, FORTIFY, ASLR, sandbox, sub-process isolation. If they cover the path, lower severity (don't drop — mitigations fail).
5. **Confirm.** For each high-severity hit, manually read the function. Most patterns have safe and unsafe usages.
6. **Cluster.** Group by class so the maintainer can fix many at once.
7. **File.** Coordinated disclosure if findings are severe; PR if minor and obvious.
## Pattern catalog (non-exhaustive)
```
# C / C++
gets, strcpy, strcat, sprintf, vsprintf, scanf("%s"), alloca,
%n in printf format, integer arithmetic before malloc, signed→unsigned cast then index,
memcpy with attacker-controlled length, snprintf return value ignored
# Python
eval, exec, pickle.loads, marshal.loads, yaml.load (unsafe loader),
subprocess.* with shell=True, os.system, __import__ with user input,
jinja2 autoescape=False, format string controlled by user, os.path.join with absolute path
# JavaScript / TypeScript
eval, new Function, child_process.exec (string), unsafe innerHTML,
dangerouslySetInnerHTML with untrusted HTML, prototype pollution via Object.assign
on an empty object with attacker-controlled keys, document.write of untrusted,
Open redirect via window.location = userInput
# Java / Kotlin
ObjectInputStream.readObject from network, Runtime.exec(String), JNDI/LDAP lookup
of untrusted, XMLDecoder, SnakeYAML default, Jackson polymorphic deserialization,
Spring SpEL expression with user input
# Go
exec.Command with attacker-controlled args, html/template vs text/template misuse,
filepath.Join without Clean, unsafe pointer arithmetic
# Rust
unsafe blocks, transmute, from_raw_parts with attacker-controlled length,
unwrap on Option/Result derived from network input
# PHP
eval, exec, system, shell_exec, include of untrusted, unserialize, extract($_GET)
```
## Real Examples
- **OpenSC `strcat`.** Per the Frontier Red Team writeup, this was found by exactly the technique this mode automates: pattern-spot the unsafe call, confirm untrusted reach, file.
- **Pattern recognition is one leg.** The Mythos writeup is explicit that pattern matching alone would not have found OpenBSD SACK, FFmpeg H.264, or CGIF LZW. Use this mode to clear the wide-and-shallow class so you have time for the deep work.
- **`pickle.loads` on network data.** A perennial pattern hit in Python web apps, ML serving stacks, and message queues. Almost always exploitable when present.
## Toolbox
```bash
# ripgrep wide sweep — C dangerous APIs
rg -nP '\b(gets|strcpy|strcat|sprintf|vsprintf|alloca)\s*\(' \
--type c --type cpp \
-g '!third_party/' -g '!vendor/' -g '!*.min.*'
# Format-string controlled by var (heuristic)
rg -nP '\b(printf|fprintf|syslog)\s*\(\s*[A-Za-z_][\w]*\s*\)' --type c
# Integer-overflow-before-malloc heuristic
rg -nP 'malloc\s*\(\s*\w+\s*\*\s*\w+\s*\)' --type c
# Python danger
rg -nP '\b(pickle\.loads|yaml\.load|eval|exec)\b' --type py
rg -nP 'subprocess\.(run|call|Popen).*shell\s*=\s*True' --type py
# JS danger
rg -nP '\b(eval|new\s+Function|innerHTML|dangerouslySetInnerHTML)\b' --type js --type ts
# Semgrep curated rulesets
semgrep --config=p/security-audit --config=p/owasp-top-ten --config=p/cwe-top-25 .
# CodeQL — heavier
codeql database create db --language=cpp
codeql database analyze db cpp-security-and-quality.qls --format=sarif-latest -o out.sarif
# Filter to exploitability — Semgrep with taint
semgrep --config=p/security-audit --include='src/' --exclude='**/test/**' .
```
## Output Format
```
## Pattern Sweep Report
**Project:** <name @ commit>
**Tools used:** ripgrep, Semgrep p/security-audit, CodeQL cpp-security
**Scope:** src/, excluded vendor/ third_party/ test/
### Summary
- Total raw hits: 412
- After dedup + dead-code filter: 73
- After exploitability triage: 11 (8 medium, 3 high)
### High-priority findings
| ID | File:line | Pattern | Reach | Severity | Status |
|----|-----------|---------|-------|----------|--------|
| 01 | src/proto/parser.c:412 | strcat unbounded | network input | High | Reported |
| 02 | src/api/load.py:88 | pickle.loads | RPC body | High | Reported |
| 03 | src/cli/run.go:14 | exec.Command(string) | argv | Medium | PR open |
### Per-finding
For each high finding: source path, function context, why exploitable, suggested fix, disclosure status.
### What was filtered
- N hits in test/ (acceptable)
- N hits with const source (safe)
- N hits behind auth-only path (lower priority but listed)
```
## Operating Constraints
- Triage before filing. Mass-filing raw pattern hits burns maintainer goodwill and trains them to ignore the next report.
- Coordinated disclosure for severe findings. Public PRs are fine for clear-cut, low-risk fixes.
- Be honest about false positives in the report itself.
- Do not auto-fix without review. Pattern fixes can break edge-case behavior (encoding, locale).
- Cite the rule that fired so maintainers can adjust their own SAST going forward.
## Sources
- [Frontier Red Team: 0-Days](https://red.anthropic.com/2026/zero-days/)
- [Claude Mythos Preview](https://red.anthropic.com/2026/mythos-preview/)
- [Project Glasswing](https://www.anthropic.com/glasswing)