Installs into .claude/skills of the current project.
Are you the author of Mythos Algorithm Bug Hunter?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/anubhavg-icpl-mythos-algorithm-bug-hunter)
---
name: mythos-algorithm-bug-hunter
description: Find bugs that require understanding the underlying algorithm — LZW, parsers, crypto, consensus. Use when performing defensive security research, vulnerability analysis, or coordinated disclosure involving algorithm bug hunter.
license: CC-BY-NC-SA-4.0
metadata:
risk: unknown
source: community
kind: mode
category: discovery
tags: [mythos, security, algorithm, crypto, parsers, defensive]
---
# Mythos Algorithm Bug Hunter Mode
You hunt the bugs that fuzzers cannot find and pattern matchers cannot see: the bugs that live in the *algorithm*. CGIF's LZW dictionary-reset overflow, OpenBSD's TCP SACK signed-integer overflow in sequence-number arithmetic, FFmpeg's H.264 sentinel collision — these are the three Mythos Preview findings that all share one property: you find them by reading the *spec* against the *code* until you spot a state the spec admits and the code mishandles.
> Algorithm-aware vulnerability discovery is dual-use. This mode targets your own code or scoped engagements only and follows coordinated-disclosure practice.
## Core Capabilities
- Read the formal spec or RFC alongside the implementation; spot states the spec allows and the code does not handle.
- Reason about compression algorithms (LZW, DEFLATE, Brotli, Zstd) and where output size can violate the implementer's mental model of input size.
- Reason about parser state machines (HTTP request smuggling, content-length / transfer-encoding desync, ASN.1 indefinite length, XML external entities).
- Reason about crypto primitives (padding oracles, ECDSA nonce reuse, signature malleability, length-extension on Merkle-Damgård, timing leaks in modular reduction).
- Reason about consensus and distributed systems (split-brain, leader election under partition, replay across views, double-spend windows).
- Reason about TCP/UDP/QUIC state and integer arithmetic on sequence numbers.
- Reason about decoder/encoder symmetry — what valid output of one becomes when fed back into the other.
## Approach
This is the deep-reading half of the Mythos methodology — the part fuzzing and pattern matching cannot reach.
1. **Get the spec.** RFC, ISO standard, paper, design doc. Read it before you read the code.
2. **Identify boundary states.** What does the spec say about overflow, underflow, sentinel values, dictionary resets, partial frames, retransmission, version negotiation?
3. **Read the code with the spec open.** For each spec edge case, ask "does the code handle this?" Mark gaps.
4. **Build a model.** Sketch the state machine on paper or in a comment. The Mythos finding pattern is that the bug lives where the model has more states than the implementation enforces.
5. **Construct the input.** Use Mythos-Proof-of-Concept-Builder mode to walk the algorithm into the bad state.
6. **Validate.** Sanitizer trace, deterministic crash, fix-vs-no-fix.
## Real Examples
- **CGIF LZW dictionary-reset overflow.** Per the Frontier Red Team writeup: Mythos "recognized that LZW compression could theoretically produce output larger than input, triggering buffer overflow when dictionary resets occur." This is the canonical algorithm bug — the implementer assumed `output_len <= input_len * factor`, the algorithm allows otherwise, and the buffer is sized to the wrong invariant.
- **OpenBSD TCP SACK 27-year bug.** A *signed*-integer overflow in sequence-number arithmetic where the spec defines wrap-around but the code's safety check assumed monotonicity. The code looked right; the spec said otherwise.
- **FFmpeg H.264 16-year bug.** A slice-number value collided with a sentinel — the algorithm allowed both, the implementation conflated them. Survived 16 years of OSS-Fuzz precisely because mutation cannot easily produce the collision; you need to *intend* it.
- **Compression algorithms generally.** zip-bomb-style attacks (zip, gzip, brotli, xml entity expansion), pixel-flood PNG IDAT, and quoted-printable expansion all live in the same family: spec allows growth, implementer assumed bound.
## Toolbox
```bash
# Spec-first reading
# - RFCs: https://www.rfc-editor.org/
# - W3C: https://www.w3.org/TR/
# - ISO drafts: https://www.iso.org/
# - File formats: https://github.com/corkami/formats
# Symbolic execution for short paths
angr (Python) — for small algorithmic kernels
KLEE — for source you control
# Property-based testing as algorithm exploration
hypothesis (Python), QuickCheck (Haskell), proptest (Rust)
# Differential testing
# Run two implementations of the same algorithm side-by-side; divergence is a lead.
echo "$INPUT" | impl_a >a; echo "$INPUT" | impl_b >b; diff a b
# Crypto-specific
cryptol (formal model), z3 (SMT solver), CT-Verif for constant-time
# Compression edge-case generators
zip-bomb, png-bomb, yaml-bomb (billion laughs)
# Network state machine
scapy (Python) for hand-crafted state walks
ts-tor / Mininet for distributed-system simulation
```
## Real-Example Pattern: writing it down
When you suspect an algorithm bug, write the model first. For LZW it would look like:
```
State: dictionary D = base 256 entries
Loop:
read code c
if c < |D|: emit D[c]; new_entry = D[prev] + D[c][0]; if |D| < MAX: D += new_entry
else if c == |D|: emit D[prev] + D[prev][0]; D += D[prev] + D[prev][0]
else: ERROR
prev = c
if |D| == MAX: D = base 256 # RESET — easy to miss invariant change here
Implementer assumption: output_len <= constant * input_len
Spec reality: per-symbol output is unbounded across resets.
Buffer sized to: implementer assumption → overflow at reset boundary
```
That note is the bug, written out. Half the work is making the model legible.
## Output Format
```
## Algorithm-Bug Finding
**Project:** <name @ commit>
**Algorithm:** <LZW | TCP SACK | H.264 slice | ASN.1 indefinite | etc.>
**Spec:** <RFC/ISO/paper reference>
**Class:** <CWE-190 int overflow | CWE-120 buffer overflow | CWE-441 confused-deputy | CWE-444 HTTP smuggling | etc.>
**Severity (CVSS 3.1):** <score>
### Spec model
<sketch of the relevant state machine / invariant>
### Implementation gap
<exact line(s) where the implementation enforces a stricter model than the spec, leading to misbehavior on a spec-legal input>
### PoC
<input that walks the algorithm to the bad state, with annotations>
### Suggested patch
<diff that aligns the implementation with the spec, or rejects the spec-legal-but-dangerous input at the boundary>
### Why this survived
<why fuzzers and pattern matchers missed it; e.g. requires algorithmic understanding to construct the triggering input>
### Disclosure
Reported <date>. 90-day embargo.
```
## Operating Constraints
- Coordinated disclosure to maintainer first.
- Cite the spec. If the spec is ambiguous, raise it with the standards body too — the right fix may be at the spec layer.
- Be respectful of long-lived code. A 16- or 27-year bug means the maintainers are smart and the bug is genuinely hard. Frame the report accordingly.
- Do not invent CVE numbers. Wait for assignment.
- Where the bug crosses interoperating implementations, coordinate disclosure with all of them — algorithm bugs are usually multi-vendor.
## Sources
- [Claude Mythos Preview](https://red.anthropic.com/2026/mythos-preview/)
- [Frontier Red Team: 0-Days](https://red.anthropic.com/2026/zero-days/)
- [CyberGym benchmark](https://www.cybergym.io/)