Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:0sec labs 0 Variant Detection

From Leeroopedia
Knowledge Sources
Domains Binary_Analysis, Variant_Analysis, Bug_Detection
Last Updated 2026-10-30 00:00 GMT

Overview

Technique for applying a seed matcher to a fleet member's decompiled code or raw bytes to find and rank candidate sites of the same bug class, with deduplication and similarity scoring.

Description

Variant detection applies the seed's matcher to each fleet member. When decompiled code is available, the bugclass lens or seedbug pattern matcher scans each function for the seed's source→sink pattern. When no decompiler is available (stripped firmware), a high-recall symbol pass checks for surviving sink and source symbols in raw bytes. Candidates are ranked by reference-similarity (highest first) — when a reference shape was attached to the seed, similarity measures how closely the candidate's function body matches the reference. Candidates are deduplicated per (function, sink), keeping the strongest match. The detector field records the detection origin (lens:*, seed:*, symbol-pass).

Usage

Use this principle when you need to find all candidate sites of a known bug class across a fleet. The detection is high-recall by design — PoV-is-truth filters false positives downstream.

Theoretical Basis

The detection algorithm:

# Abstract algorithm (NOT real implementation)
if member.decompiled:
    if seed.matcher_kind == "bugclass":
        candidates = bugclass_lens(seed.bug_class, member.decompiled)
    else:
        candidates = seedbug_matches(seed.seedbug, member.decompiled)
    for c in candidates:
        c.similarity = seed.reference.similarity(c.body) if seed.reference else 1.0
else:
    candidates = symbol_pass(seed.sink_symbols, seed.source_symbols, raw_bytes)

# dedup by (function, sink), keep highest similarity
candidates = dedup_and_rank(candidates)

The symbol pass is the low-precision fallback: it checks whether sink symbol strings (e.g., system, strcpy) appear in the raw bytes. This is intentionally high-recall — the confirmation oracle filters the noise.

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment