
Research and hands-on PoC of Spectre Variant 2 (CVE-2017-5715), a hardware side-channel vulnerability exploiting CPU speculative execution and branch prediction. Includes lab setup, vulnerability identification, exploit walkthrough, cache-timing analysis, demo video, and mitigation strategies.
An in-depth research paper and hands-on Proof-of-Concept (PoC) exploring speculative execution attacks on modern CPUs.
This project is a research and lab-based exploration of Spectre Variant 2 (CVE-2017-5715), also known as Branch Target Injection — a hardware-level side-channel vulnerability affecting CPUs that implement speculative execution and branch prediction.
The goal of this project was to:
⚠️ Disclaimer: This work was conducted strictly in a controlled, isolated virtual machine for academic and educational purposes. It does not target or affect any production system, and no proprietary exploit code was authored — the publicly available SpectrePoC repository was used for demonstration.
CVE-2017-5715 is a microprocessor vulnerability that allows an attacker to trick a CPU's branch predictor into executing instructions along an incorrect ("speculative") path. While the CPU correctly discards the results of this misprediction, it fails to fully erase the side effects — most notably, changes to the CPU cache state. These residual cache changes can be measured using timing analysis, allowing an attacker to infer secret data that should never have been accessible.
Unlike traditional software bugs, Spectre exploits the hardware design of modern CPUs, making it extremely difficult to patch completely and requiring a combination of microcode, OS, and compiler-level mitigations.
| Component | Details |
|---|---|
| Operating System | Ubuntu 14.04 LTS |
| Kernel Version | 4.4.0-148-generic |
| CPU | 12th Gen Intel® Core™ i5-12450H |
| Virtualization | VMware Workstation |
| PoC Repository | crozone/SpectrePoC |
sudo apt update
sudo apt install git
git clone https://github.com/crozone/SpectrePoC
cd SpectrePoC
make
Linux exposes CPU vulnerability/mitigation status directly through sysfs:
grep . /sys/devices/system/cpu/vulnerabilities/*
This confirmed the test CPU was vulnerable to spectre_v2, while other related vulnerabilities (Meltdown, L1TF, MDS) were either mitigated or not affected.
./spectre.out
The tool repeatedly reports Success results alongside a confidence "score," derived from cache-timing differences — each successful read represents one leaked byte of otherwise inaccessible memory, reconstructed entirely through the speculative side channel.
A recorded walkthrough of the full PoC — from environment setup to successful data exfiltration — is included in this repository to visually validate the attack.
📁 Update the path above once the video file is added to your repository (e.g. place it in a
demo/ormedia/folder and adjust the link accordingly).
Indirect Branch Restricted Speculation (IBRS), and similar mitigations reduce cross-boundary leakage..
├── README.md
├── Research_Paper_-_CVE-2017-5715_Spectre_by_Shivam_Bhatt.pdf
└── demo/
└── spectre-poc-demo.mp4
Shivam Bhatt Cybersecurity Post-Graduate Diploma (Honours) — NAIT 🔗 Feel free to connect on LinkedIn or reach out for collaboration on cybersecurity research.
⭐ If you found this research useful, consider starring the repo!