
Educational laboratory for studying CVE-2014-0160 (Heartbleed) and framing inconsistencies in TLS heartbeat handling.
Educational laboratory for studying the Heartbleed vulnerability
(CVE-2014-0160) using a real vulnerable OpenSSL environment inside Docker.
This project reproduces a vulnerable TLS server using OpenSSL 1.0.1f and implements a custom raw TLS heartbeat client to demonstrate how malformed heartbeat packets can trigger memory disclosure.
The lab was created for educational and research purposes, especially for studying:
heartbleed-lab/
├── client/
│ ├── attacker.py
│ └── Dockerfile
│
├── vulnerable/
│ ├── Dockerfile
│ └── server/
│
├── fixed/
│ ├── Dockerfile
│ └── server/
│
├── docs/
│ └── diagrams/
│
├── notes/
│
├── docker-compose.yml
├── .gitignore
└── README.md
heartbleed-client
↓
Docker internal network
↓
vulnerable-heartbleed
Where:
heartbleed-client sends raw TLS recordsvulnerable-heartbleed runs OpenSSL 1.0.1fThe vulnerable server uses:
openssl s_serverThe environment is intentionally configured to reproduce the original Heartbleed behavior.
The client implementation:
The current implementation reproduces the original Heartbleed behavior by sending a malformed heartbeat packet where:
payload_length > real payload size
Example:
Declared payload length: 0x4000
Real payload: 1 byte ("A")
The vulnerable server incorrectly trusts the declared length and responds with memory contents beyond the actual payload boundaries.
sudo COMPOSE_HTTP_TIMEOUT=300 docker-compose up --build
sudo docker exec -it heartbleed-client bash
python attacker.py
[+] Sending malformed heartbeat
[+] Got TLS record: type=24 version=(3, 2) length=16384
[!!!] Heartbeat response received
This indicates that the vulnerable server returned memory contents beyond the legitimate heartbeat payload.
This project explores the relationship between:
One of the main research interests of this lab is comparing:
HTTP Request Smuggling
vs
TLS Heartbeat Parsing Failures
from the perspective of:
Planned next steps include:
This repository exists solely for: