Implementation:0sec labs 0 Fleet Seed Construction
| Knowledge Sources | |
|---|---|
| Domains | Binary_Analysis, Variant_Analysis, Bug_Classification |
| Last Updated | 2026-10-29 00:00 GMT |
Overview
Concrete tool for building a fleet sweep seed matcher from a bug archetype, a reference function, or a confirmed finding, provided by the 0verse fleet module.
Description
The seed_from_archetype function builds a FleetSeed matcher from an explicit archetype id — a bug-class id (cmdi, overflow), a seed-bug-class id (firmware:cgi-cmdi), or a seed-catalog uid (kernel/DRV-01). seed_from_reference decompiles a reference vulnerable function in a real binary, classifies its bug archetype by running every lens over it, and captures its shape as a binary-diff reference. seed_from_finding builds the matcher from an already-confirmed finding — the cheapest seed since a prior scan already proved the bug is real.
Usage
Import these functions when you need to start a fleet variant sweep from a known bug archetype, a reference vulnerability, or a prior confirmed finding. They are Step 1 of the fleet variant analysis workflow.
Code Reference
Source Location
- Repository: 0security
- File: 0verse/src/zeroverse/fleet.py:L237-326
Signature
def seed_from_archetype(archetype_id: str) -> FleetSeed:
"""Build a FleetSeed from a bug-class, seed-bug-class, or catalog uid."""
def seed_from_reference(binary: str | Path, function: str) -> FleetSeed:
"""Decompile a reference function, classify its archetype, capture shape."""
def seed_from_finding(
*,
bug_class: str,
function: str,
decompiled_c: str,
archetype_id: str = "",
) -> FleetSeed:
"""Build the matcher from an already-confirmed finding's archetype."""
@dataclass(frozen=True)
class FleetSeed:
archetype_id: str
bug_class: str
cwe: str
framing: str
route: str # userland | firmware | kernel-verify
sink_symbols: tuple[str, ...]
source_symbols: tuple[str, ...]
matcher_kind: str # bugclass | seedbug
seedbug: SeedBugClass | None = None
reference: ReferenceShape | None = None
Import
from zeroverse.fleet import seed_from_archetype, seed_from_reference, seed_from_finding, FleetSeed
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| archetype_id | str | For seed_from_archetype | Bug-class, seed-bug-class, or catalog uid |
| binary | Path | For seed_from_reference | Reference binary path |
| function | str | For seed_from_reference | Reference function name |
| bug_class | str | For seed_from_finding | Finding's bug class id |
| decompiled_c | str | For seed_from_finding | Function body that carried the bug |
Outputs
| Name | Type | Description |
|---|---|---|
| return | FleetSeed | Frozen dataclass: matcher (bugclass/seedbug), route, symbols, optional reference shape |
Usage Examples
From a bug archetype
from zeroverse.fleet import seed_from_archetype
seed = seed_from_archetype("cmdi")
print(f"Bug class: {seed.bug_class}, Route: {seed.route}")
print(f"Sinks: {seed.sink_symbols}")
From a reference vulnerable function
from zeroverse.fleet import seed_from_reference
seed = seed_from_reference("./known_vulnerable_binary", "process_input")
print(f"Detected class: {seed.bug_class}")
print(f"Reference shape attached: {seed.reference is not None}")
From a confirmed finding
from zeroverse.fleet import seed_from_finding
seed = seed_from_finding(
bug_class="overflow",
function="parse_header",
decompiled_c="void parse_header(char *buf) { strcpy(dst, buf); }",
)