QWED

Type to search pages, engines and advisories.

    Looking for API details?Search the docs

    Security·Advisories·GHSA-jppc-7r58-7pjh

    SDK VerificationResult reports is_verified=True for BLOCKED/UNVERIFIABLE results; GitHub Action admits them

    highFixed in 8.0.0GHSA-jppc-7r58-7pjh · Published 26 October 2026

    Summary

    The Python SDK maps a server response to VerificationResult.is_verified from the raw is_valid field and ignores status and admission. A response the server marked BLOCKED / UNVERIFIABLE with admission: "BLOCKED" becomes is_verified=True in the SDK whenever the body also carries is_valid: true. The QWED GitHub Action then turns is_verified into admission=ADMIT and skips its failing exit. A result the server refused to admit is reported as verified and passes the CI gate.

    This contradicts ADR-003 (docs/adr/ADR-003-truth-vs-admission.md): consumers must gate exclusively on admission == "ADMIT", and is_valid "is not an alternative authorization gate".

    Affected components

    Component Location Behaviour
    qwed_sdk.models.VerificationResult.from_dict qwed_sdk/models.py L41-50 is_verified=data.get("is_verified", data.get("is_valid", False))
    QWEDClient / QWEDAsyncClient methods that return from_dict(...) qwed_sdk/client.py: verify, verify_logic, verify_math, verify_fact, verify_stats, and the API fallbacks of verify_code / verify_sql All inherit the mapping
    GitHub Action verify mode action_entrypoint.py action_verify L102-115 admission = "ADMIT" if result.is_verified else "DENY"; sys.exit(1) only when not result.is_verified

    Root cause

    1. On the server, merge_diagnostic_result() (src/qwed_new/core/diagnostics.py) flattens developer_fields into the top level of the response. So the engine's is_valid is present next to status and admission.
    2. A verdict can be downgraded to BLOCKED/UNVERIFIABLE after the engine set is_valid: true, by a trust/attestation/policy gate or any wrapper that keeps the engine's fields. admission_decision() correctly returns BLOCKED for any fail-closed status.
    3. The SDK never reads admission or status, so it promotes the leftover is_valid to is_verified.
    4. The Action trusts is_verified as the admission decision.

    Proof of concept (local, synthetic)

    from qwed_new.core.diagnostics import DiagnosticResult, admission_decision, merge_diagnostic_result
    from qwed_sdk.models import VerificationResult
    
    dr = DiagnosticResult.blocked("blocked by gate", {"constraint_id": "c", "is_valid": True})
    body = merge_diagnostic_result(dr); body["admission"] = admission_decision(dr).value
    print(body["status"], body["admission"])            # BLOCKED BLOCKED
    print(VerificationResult.from_dict(body).is_verified)  # True   <-- should be False
    

    Observed output on 7.3.0 and on main @ 52d3e06: BLOCKED BLOCKED / True. The same happens for DiagnosticResult.unverifiable(...).

    Downstream: with that body, the Action prints Verdict: True, emits admission=ADMIT, and exits 0 (CI passes).

    Impact

    Integrity of the verification decision. Any SDK consumer or CI pipeline that gates on is_verified (the documented SDK field, and the Action's only gate) will accept LLM output that QWED explicitly refused. The attacker needs to influence the content being verified, i.e. the model output. They do not need any credentials.

    Affected versions

    • qwed on PyPI: 2.0.0 to 7.3.0. The is_valid fallback in from_dict was added in a0dcf20 (December 2025); 0.1.0 predates it. Confirmed at runtime on 7.3.0.
    • GitHub Action verify mode: v7.1.0 to v7.3.0, where the Action's admission output and exit code follow is_verified (637a880). Earlier versions read a result.verified attribute that does not exist, so the step failed closed.

    Patches

    Fixed in 8.0.0 (d1b9d7f):

    • qwed_sdk/models.py: is_admitted() applies the server's rule. Where the response carries an admission, only ADMIT admits; otherwise status must be VERIFIED and is_valid must be true. A bare is_valid or is_verified never admits on its own. VerificationResult.from_dict uses it, and the new VerificationResult.admission field carries the server's decision.
    • verify_consensus reads the server's status and meets_requirement is True.
    • The GitHub Action's verify mode gates its exit code and admission output on is_verified, and reports the server's verdict (for example VERIFIED · DENY).

    Upgrade with pip install -U qwed (8.0.0 or later) and pin the Action to QWED-AI/qwed-verification@v8.0.0.

    Workarounds

    Call the REST API directly and gate on the response's admission == "ADMIT", not on is_valid or the SDK's is_verified.

    Related

    • Public issue #327 (SDK methods lack admission/proof_ref) is adjacent but does not describe this fail-open.
    • ADR-003; #437/#438; #326 (same fail-open class, fixed only for verify_fact connectivity errors).
    All advisories