Share on XShare on LinkedInShare on Telegram
Hack Analysis

Taiko Bridge $1.7M Leaked SGX Enclave Key Exploit (Explained)

An RSA key for an L2 rollup's SGX provers sat exposed in a public GitHub repo, letting an attacker forge attestations and drain $1.7M from its bridge.

Author
QuillAudits Team
June 30, 2026
Taiko Bridge $1.7M Leaked SGX Enclave Key Exploit (Explained)
Share on XShare on LinkedInShare on Telegram

On June 21, 2026, Taiko lost approximately $1.7M when an attacker forged SGX prover attestations using a private key that had been committed to a public GitHub repository. There was no theft of a hot wallet key, no social engineering, and no flash loan involved. An RSA-3072 signing key sitting in plain sight at docker/enclave-key.pem inside the taikoxyz/raiko repo was enough to register a malicious prover that Taiko's L1 contracts trusted completely.

Protocol Background

Taiko is a based rollup that uses Intel SGX, via its Raiko prover, to attest the correctness of L2 state transitions to L1. An SGX enclave generates a signed attestation that a state transition was computed correctly inside a genuine, unmodified enclave. L1 contracts verify this by checking that the enclave's identity, its MrSigner, matches a value stored on-chain called  trustedUserMrSigner. MrSigner is derived as SHA-256 of the little-endian RSA modulus of the key used to sign the enclave, so whoever holds that RSA private key effectively controls which enclaves the protocol will ever trust.

The Bridge contract (0xd60247c6848B7Ca29eDdF63AA924E53dB6Ddd8EC) and ERC20Vault (0x996282cA11E5DEb6B5D122CC3B9A1FcAAD4415Ab) on Ethereum rely on these SGX attestations to process cross-chain messages, including processMessage() for initial relay and retryMessage() for retrying messages that did not complete on the first attempt.

Hack Analysis

The RSA-3072 private key used to sign every Taiko SGX enclave had been committed to the public taikoxyz/raiko GitHub repository, sitting on a hotfix branch where it was readable by anyone.

taiko_1.png

The attacker pulled enclave-key.pem from the repo and derived its MrSigner value, then confirmed it matched the trustedUserMrSigner value Taiko's L1 contracts already had stored on-chain.

With that confirmed, the attacker built a malicious enclave and signed it using the leaked key. The signature traced back to a key the protocol implicitly trusted, so the malicious enclave registered successfully as a legitimate SGX prover, with no compromise of Intel's actual SGX hardware required anywhere in the process.

taiko_2.png

Once registered as a trusted prover, the malicious enclave attested to fake L2 state, including bridge messages that had never occurred on Taiko's actual L2.

That forged attestation reached processMessage() on the L1 Bridge, where the proof check passed since the signature was valid for a registered MrSigner, and the message status was set to RETRIABLE.

retryMessage() then executed against that status with zero independent proof verification of its own. It simply checked that a message carried RETRIABLE status and ran it.

taiko_3.png

taiko_4.png

Repeating this path to drain the Bridge and ERC20Vault, sending stolen funds to attacker wallets 0x7506DeA0c38ca0B55364B22424374c5A1ae1B76a and 0xa98035081fb739ebe9c8f80904668fb11438a846.

Root Cause

The root cause was not a flaw in Intel SGX itself or in the cryptography behind attestations. It was operational. A private key that functioned as the protocol's entire trust root for L2 state was stored inside a Git repository that was at some point made public. Once that key leaked, the SGX trust model collapsed entirely, because nothing distinguishes a legitimate Raiko-built enclave from an attacker-built enclave signed with the same key.

Two compounding contract-level design choices turned the key leak into immediate, repeatable theft. First, processMessage() accepted any SGX attestation matching the registered MrSigner with no secondary signal, such as volume limits or a second attestation source, to catch a state transition with no corresponding event on Taiko's actual L2. Second, retryMessage() trusted the RETRIABLE status set by a single prior forged attestation rather than re-verifying proof independently, turning one successful forgery into a repeatable drain primitive instead of a contained, one-time event.

The link between the leaked key and the exploit is independently verifiable. MrSigner is just SHA-256 of the little-endian RSA modulus of the signing key, so pulling the committed enclave-key.pem and running the derivation locally reproduces the exact value Taiko's L1 contracts had stored as trustedUserMrSigner.

1-----BEGIN RSA PRIVATE KEY-----
2MIIG4wIBAAKCAYEAy2c2h0zCLmynJY+E5wpHPjz9VoaCskcxNfQVM5E1cbf3/b4j
37nPcSs/3oxvBFHTZGxnLIJY/A29Y/GKDjBIQdhT5f4p/Y2l7wAZZUEeyJs1dyybU
4F1dFKKZEOAmuXGE0p4g9pbE2RuYFfAug+SR3FDUedktg79Pa7Wn+IRG79xKrD4i0
5XR8wbxRZaubFtMJH/djC4EUBDQ1wkes0T1rvRvubqP3EdGsRBHg44B6D01pcfTUV
65/Z9f+IjQLYGNSMJiwHrFmVD42gHvMKApe5tv4No19QNz78OiTh4lUlJBY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Key import RSA
2import hashlib
3
4key = RSA.import_key(open("enclave-key.pem").read())
5modulus_le = key.n.to_bytes(key.size_in_bytes(), "big")[::-1]
6mrsigner = hashlib.sha256(modulus_le).hexdigest()
7
8print(f"MrSigner: {mrsigner}")
9

How QuillAudits Infrastructure Review Could Have Prevented This

This attack class, a leaked signing key undermining an entire trust model, is preventable through controls that exist today.

Secret scanning in CI/CD. Automated pre-commit and pre-merge scanning flags private keys, certificates, and .pem files before they ever reach a remote branch, including hotfix and feature branches that often bypass normal review.

Single-key trust roots for TEE attestation. A single RSA key controlling MrSigner for every enclave a protocol will ever accept is a single point of total failure. A QuillAudits infrastructure review would recommend multi-party enclave signing or a key rotation and revocation path that does not require a full contract upgrade to respond to a leak.

Defense in depth on retry paths. retryMessage() executing on RETRIABLE status alone, without re-checking the underlying proof, converts any successful forgery into a repeatable drain primitive. Retry logic handling cross-chain value transfer should re-verify proofs independently rather than trusting a status flag set earlier in the same trust chain.

Repository hygiene on hotfix branches. The leaked key sat in a hotfix branch, exactly the kind of fast-moving, lower-scrutiny branch where build artifacts and secrets are most likely to slip past review. QuillAudits recommends the same secret-handling standards apply regardless of branch type.

Funds Flow After Attack

Stolen funds moved to two attacker-controlled wallets,  0x7506DeA0c38ca0B55364B22424374c5A1ae1B76a and 0xa98035081fb739ebe9c8f80904668fb11438a846 and to Tornado Cash. Taiko paused the bridge shortly after confirming the exploit. The team has stated no user has lost funds, with the protocol replenishing the bridge from its own resources so that every L2 asset remains backed 1:1 by its Ethereum counterpart.

taiko_5.pngtaiko_6.pngtaiko_7.png

Post-Attack Mitigation

Shortly after the attack, Taiko confirmed the exploit, explaining that forged message proofs had been accepted on L1 with no corresponding event on the source chain, letting the attacker register fraudulent withdrawals against the bridge and token vault, with losses estimated near $1.7M before the bridge was paused.

Taiko then announced it was ready to bring the chain back, stating the June 21 attack path had been closed and the fixes independently reviewed, and laid out a four-step staged plan covering fix deployment and finalized-state verification, replenishing the bridge 1:1, restoring the network, and finally reopening the bridge with conservative withdrawal quotas, while reiterating that no user would lose funds.

 

Taiko confirmed the first step of that plan was complete, with the Security Council having executed the fix proposal and the chain's finalized state checking out clean, no forged checkpoints and no attacker claims left reachable.

Taiko confirmed the network was back online, with the bridge fully replenished so every asset is matched 1:1 by its Ethereum counterpart and transfers, swaps, and trading restored as normal, leaving only the final step, reopening the bridge to Ethereum, still pending.

Relevant Addresses and Transactions

SGX Prover Register Transaction

0x2f44dc1b883522a88f9b0cbbdfabf9ec33884b69dd4326600c3fab7fb2277260

Bridge Contract

0xd60247c6848B7Ca29eDdF63AA924E53dB6Ddd8EC

ERC20Vault

0x996282cA11E5DEb6B5D122CC3B9A1FcAAD4415Ab

Leaked Signing Key

docker/enclave-key.pem on taikoxyz/raiko

Attacker Wallets

Major Drain Transactions

Conclusion

Taiko's SGX trust model depended entirely on one RSA key staying private. It did not. A .pem file sitting in a public hotfix branch let an attacker forge prover registration, fake L2 state, and walk a forged message through retryMessage()'s missing proof check. No hardware was broken, no cryptography was defeated. A leaked secret and a retry path that trusted status over proof did the rest. The fix was secret hygiene, not new cryptography.

Contents

Tell Us About Your Project
Subscribe to Newsletter
hashing bits image
Loading...
cta-bg

WE SECURE EVERYTHING YOU BUILD.

From day-zero risk mapping to exchange-ready audits — QuillAudits helps projects grow with confidence. Smart contracts, dApps, infrastructure, compliance — secured end-to-end.

QuillAudits Logo


ISO 27001
DeFi Security AllianceplumeUniswap FoundationAethiropt-collectivePolygon SPNBNB Chain Kickstart

All Rights Reserved. © 2026. QuillAudits - LLC