Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1336 CNY

100%

CVE-2018-15133 PoC — Laravel Framework 安全漏洞

Source
Associated Vulnerability
Title: Laravel Framework 安全漏洞 (CVE-2018-15133)
Description:In Laravel Framework through 5.5.40 and 5.6.x through 5.6.29, remote code execution might occur as a result of an unserialize call on a potentially untrusted X-XSRF-TOKEN value. This involves the decrypt method in Illuminate/Encryption/Encrypter.php and PendingBroadcast in gadgetchains/Laravel/RCE/3/chain.php in phpggc. The attacker must know the application key, which normally would never occur, but could happen if the attacker previously had privileged access or successfully accomplished a previous attack.
Readme
# CVE-2018-15133 - Laravel APP_KEY Unserialization Vulnerability

화이트햇스쿨 3기 28반 이예빈 가상화 - 취약한 도커 구성
https://github.com/yeahhbean/Laravel-CVE-2018-15133

## 개요

이 프로젝트는 **CVE-2018-15133** 취약점(라라벨 APP_KEY 역직렬화 취약점)을 검증(PoC)하기 위해 구성된 Docker 기반 환경입니다.  
Dockerfile과 docker-compose.yaml만으로 취약한 환경을 구축하고, exploit을 통해 정상적으로 PoC가 이루어짐을 확인했습니다.

- 취약 대상 : Laravel <= 5.7.27
- 주요 이슈 : APP_KEY가 노출될 경우 악성 페이로드를 통해 서버 명령어 실행 가능

---

## 구성 환경

- **PHP** 7.2.10-fpm
- **Nginx** (reverse proxy)
- **MySQL** 5.7
- **Laravel** 5.7.28 (취약 버전 포함)

Dockerfile과 docker-compose.yaml을 통해 자동으로 취약한 환경이 설치 및 구동됩니다.

---

## 파일 구성

| 파일명              | 설명                                |
| :------------------ | :---------------------------------- |
| Dockerfile          | PHP + Composer + Laravel 5.7 설치용 |
| docker-compose.yaml | 전체 서비스(Nginx, PHP, MySQL) 구성 |
| nginx/default.conf  | Nginx 리버스 프록시 설정 파일       |
| exploit.py          | APP_KEY 기반 PoC 코드               |

---

## 로컬 환경 동작

- 디렉토리 구조
  ![디렉토리 구조](https://github.com/yeahhbean/Laravel-CVE-2018-15133/blob/main/images/init_build.png?raw=true)

- 디렉토리 이동 cd C:\Users\Admin\Desktop\WHS\CVE
  ![디렉토리 이동](https://github.com/yeahhbean/Laravel-CVE-2018-15133/blob/main/images/init_build1.png?raw=true)

- 도커 이미지 빌드 docker-compose build
  ![도커 이미지 빌드](https://github.com/yeahhbean/Laravel-CVE-2018-15133/blob/main/images/docker_build.png?raw=true)

- 도커 컨테이너 실행 docker-compose up -d
  ![도커 컨테이너 실행](https://github.com/yeahhbean/Laravel-CVE-2018-15133/blob/main/images/docker_compose.png?raw=true)

- 컨테이너 접속 docker exec -it laravel_app bash
  ![컨테이너 접속](https://github.com/yeahhbean/Laravel-CVE-2018-15133/blob/main/images/laravel_app_APP_KEY.png?raw=true)

- 컨테이너에서 나와서 PoC 실행 exit python exploit.py
  ![PoC 결과 1](https://github.com/yeahhbean/Laravel-CVE-2018-15133/blob/main/images/exploit_1.png?raw=true)
  ![PoC 결과 2](https://github.com/yeahhbean/Laravel-CVE-2018-15133/blob/main/images/exploit_2.png?raw=true)
  ![PoC 결과 3](https://github.com/yeahhbean/Laravel-CVE-2018-15133/blob/main/images/exploit_3.png?raw=true)

- 브라우저 접속 웹 브라우저를 열고 http://localhost:8080
  ![로컬페이지](https://github.com/yeahhbean/Laravel-CVE-2018-15133/blob/main/images/localhost.png?raw=true)

---

## 구축 방법

```bash
# 1. 소스 다운로드 및 디렉토리 이동
cd [프로젝트 디렉토리]

# 2. Docker 이미지 빌드
docker-compose build

# 3. Docker 컨테이너 실행
docker-compose up -d

---

성공적으로 실행되면 http://localhost:8080에서 Laravel 기본 페이지를 확인할 수 있습니다.

---

## PoC (취약점 검증)

# 1. 컨테이너 안에서 Laravel APP_KEY 추출
docker exec -it laravel_app bash
cat /var/www/html/laravel/.env | grep APP_KEY

# 2. 추출된 APP_KEY를 이용하여 exploit.py에 입력 후 실행
python exploit.py

# 3. 정상적으로 Laravel 페이지 HTML이 반환되면, APP_KEY를 통한 페이로드가 성공적으로 전달되었음을 의미합니다.

---

## 주의 사항

- Laravel 5.7.28 이후 버전은 이 취약점이 패치되어 더 이상 작동하지 않습니다.

- PoC 코드(exploit.py)는 공개된 공격 방식을 참고하여 작성되었습니다.

---

## Reference

- https://nvd.nist.gov/vuln/detail/cve-2018-15133
- https://laravel.com/docs/5.7/releases#laravel-5.7.27

```
File Snapshot

Log in to view the POC file snapshot cached by Shenlong Bot

Log in to view
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →