
Autor: Sushin Ivan
Data: Março 2026
Este repositório contém os resultados de um security review completo da vulnerabilidade CVE-2024-3094 (Supply Chain Attack na biblioteca XZ Utils).
Objetivo do trabalho:
Artefatos:
| Arquivo | Descrição |
|---|---|
docs/ThreatModel.md | Modelo de ameaças STRIDE + diagrama |
docs/Report_Final.pdf | Relatório final (57+ páginas) |
exploit/PoC.py | Proof-of-Concept da vulnerabilidade |
tests/ | Conjunto de testes automatizados (pytest) |
reports/Findings.xlsx | Tabela de achados do Security Review |
presentation/ | Slides e vídeo da apresentação |
cd kaspersky_task_SushinIvan
# Construir a imagem
docker build -t cveanalysis:1.0 .
# Verificar a imagem
docker images | grep cveanalysis
# Executar o container
docker run -it --rm --privileged -v $(pwd):/work cveanalysis:1.0
cd /work/src/vulnerable-code/build
# Limpar cache
rm -rf CMakeCache.txt CMakeFiles/
# Configuração
cmake .. -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug \
-DUSE_ATTR_IFUNC=OFF -DENABLE_NLS=OFF
# Build
make -j$(nproc)
# Verificar versão
./xz --version
# Saída esperada: xz (XZ Utils) 5.6.1
cd /work/src/patched-code/build
# Limpar cache
rm -rf CMakeCache.txt CMakeFiles/
# Configuração
cmake .. -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug \
-DUSE_ATTR_IFUNC=OFF -DENABLE_NLS=OFF
# Build
make -j$(nproc)
# Verificar versão
./xz --version
# Saída esperada: xz (XZ Utils) 5.6.2
cd /work/src/vulnerable-code/build
# Build
make -j$(nproc)
# Executar testes do projeto
make test
# Resultado esperado: All tests passed
# Instalar dependências
cd /work
pip3 install -r tests/requirements.txt
# Executar pytest
python3 -m pytest tests/ -v
Resultado esperado: 5 passed
Static Analysis
# Análise de símbolos (nm)
nm -C liblzma.a | grep -iE "ssh|backdoor|hook|init"
# Cppcheck
cppcheck --enable=all --inconclusive src/liblzma 2> reports/cppcheck_log.txt
Dynamic Analysis
# AddressSanitizer (build com flags)
cmake .. -DCMAKE_C_FLAGS="-fsanitize=address -g"
# Valgrind
valgrind --leak-check=full ./exploit/test_trigger
# AFL++ Fuzzing (30 minutos)
timeout 1800 afl-fuzz -i fuzzing/inputs -o fuzzing/outputs -- ./exploit/test_trigger_afl @@
.
├── Dockerfile # Imagem Docker
├── README.md # Este arquivo
├── Report_Final.pdf # Relatório final
├── docs/
│ ├── ThreatModel.md # Modelo de ameaças
│ └── threat_model.png # Diagrama
├── exploit/
│ ├── PoC.py # Proof-of-Concept
│ ├── test_trigger.c # Teste para ASAN/AFL++
│ ├── test_trigger # Binário
│ └── test_trigger_afl # Binário instrumentado
├── tests/
│ ├── src/
│ │ └── test_cve2024_3094.py # Testes automatizados
│ ├── CMakeLists.txt # Configuração dos testes
│ └── requirements.txt # Dependências Python
├── reports/
│ ├── Findings.xlsx # Tabela de achados
│ ├── asan_test_output.txt # Logs do ASAN
│ ├── valgrind_log.txt # Logs do Valgrind
│ ├── cppcheck_log.txt # Logs do Cppcheck
│ ├── afl_fuzzing_log.txt # Logs do AFL++
│ └── version_*.txt # Versões dos builds
└── presentation/
└── slides.md # Slides da apresentação
| Componente | Versão | Finalidade |
|---|
| Docker Engine | 20.10+ | Containerização do ambiente |
| Git | 2.20+ | Controle de versão |
| Python | 3.8+ | Testes e scripts |
| GCC/Clang | 9.0+ | Compilação do XZ Utils |