[Paper Review] CopyCat: Controlled Instruction-Level Attacks on Enclaves
COPYCAT is a novel deterministic, instruction-level side-channel attack targeting Intel SGX enclaves that exploits architectural interrupts to count executed instructions with perfect precision. By combining this interrupt-counting channel with existing page-table access leakage, the attack achieves maximal, noise-free instruction-level control flow reconstruction, enabling single-trace key extraction from hardened cryptographic libraries despite countermeasures.
The adversarial model presented by trusted execution environments (TEEs) has prompted researchers to investigate unusual attack vectors. One particularly powerful class of controlled-channel attacks abuses page-table modifications to reliably track enclave memory accesses at a page-level granularity. In contrast to noisy microarchitectural timing leakage, this line of deterministic controlled-channel attacks abuses indispensable architectural interfaces and hence cannot be mitigated by tweaking microarchitectural resources. We propose an innovative controlled-channel attack, named CopyCat, that deterministically counts the number of instructions executed within a single enclave code page. We show that combining the instruction counts harvested by CopyCat with traditional, coarse-grained page-level leakage allows the accurate reconstruction of enclave control flow at a maximal instruction-level granularity. CopyCat can identify intra-page and intra-cache line branch decisions that ultimately may only differ in a single instruction, underscoring that even extremely subtle control flow deviations can be deterministically leaked from secure enclaves. We demonstrate the improved resolution and practicality of CopyCat on Intel SGX in an extensive study of single-trace and deterministic attacks against cryptographic implementations, and give novel algorithmic attacks to perform single-trace key extraction that exploit subtle vulnerabilities in the latest versions of widely-used cryptographic libraries. Our findings highlight the importance of stricter verification of cryptographic implementations, especially in the context of TEEs.
Motivation & Objective
- To develop a new class of controlled-channel attacks that achieve instruction-level resolution in enclave side-channel leakage.
- To demonstrate that deterministic, noise-free control flow leakage is possible at the instruction level, even when microarchitectural side channels are mitigated.
- To show that widely deployed cryptographic libraries remain vulnerable to single-trace key recovery attacks despite existing side-channel countermeasures.
- To challenge the assumption that coarse-grained page-level monitoring is the maximum practical resolution for controlled-channel attacks.
Proposed method
- Leverages the SGX-Step framework to force single-instruction stepping into a victim enclave, enabling precise interrupt counting.
- Uses architectural interrupts as a deterministic channel to count the number of instructions executed within a single enclave code page.
- Combines the fine-grained interrupt count with coarse-grained page-table access patterns as a secondary oracle to reconstruct control flow at instruction-level granularity.
- Exploits the fact that each interrupt corresponds to one executed instruction, enabling deterministic instruction counting without reliance on timing variations.
- Applies the interrupt-counting technique to analyze control flow in cryptographic primitives such as modular inversion and scalar multiplication.
- Develops novel algorithmic attacks that recover cryptographic keys from a single control flow trace by analyzing instruction-level deviations.
Experimental results
Research questions
- RQ1Can architectural interrupts be used as a deterministic, noise-free channel to count instructions inside an SGX enclave?
- RQ2To what extent can instruction-level control flow be reconstructed using only interrupt counts and page-table access patterns?
- RQ3Are modern cryptographic libraries, hardened against microarchitectural side channels, still vulnerable to instruction-level controlled-channel attacks?
- RQ4Can single-trace, deterministic attacks be constructed that recover cryptographic keys from real-world implementations?
Key findings
- COPYCAT achieves instruction-level resolution in control flow leakage by using architectural interrupts as a deterministic counting channel, eliminating measurement noise.
- The attack successfully reconstructs intra-page and intra-cache line branch decisions that differ by only a single instruction.
- Single-trace key extraction attacks were demonstrated on real-world cryptographic libraries, including DSA, ECDSA, and RSA key generation, despite the presence of side-channel countermeasures.
- The attack bypasses microarchitectural defenses such as buffer flushing and resource partitioning because it relies on architectural interfaces, not microarchitectural states.
- Even hardened libraries using techniques like always-add-and-double and exponent masking were broken by COPYCAT due to secret-dependent control flow at the instruction level.
- The attack was validated on Intel SGX using extensive experiments, showing practical feasibility and high precision in real-world scenarios.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.