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

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2025-43300 PoC — Apple多款产品 安全漏洞

Source
Associated Vulnerability
Title:Apple多款产品 安全漏洞 (CVE-2025-43300)
Description:An out-of-bounds write issue was addressed with improved bounds checking. This issue is fixed in iOS 15.8.5 and iPadOS 15.8.5, iOS 16.7.12 and iPadOS 16.7.12, iOS 18.6.2 and iPadOS 18.6.2, iPadOS 17.7.10, macOS Sequoia 15.6.1, macOS Sonoma 14.7.8, macOS Ventura 13.7.8. Processing a malicious image file may result in memory corruption. Apple is aware of a report that this issue may have been exploited in an extremely sophisticated attack against specific targeted individuals.
Readme
## 📚 CVE-2025-43300 - Análise Detalhada da Vulnerabilidade

### 🎯 **Resumo**
A CVE-2025-43300 é uma vulnerabilidade de **buffer overflow** no processamento de arquivos DNG (Digital Negative) que ocorre devido a uma **inconsistência entre metadados TIFF e dados JPEG**, permitindo execução remota de código (RCE).

---

## 🔍 **1. ANATOMIA DO ARQUIVO DNG**

### Estrutura em Camadas:
```
DNG File
├── TIFF Container (metadados)
│   ├── Header
│   ├── IFD (Image File Directory)
│   │   ├── Tag 277: SamplesPerPixel (declara quantos componentes)
│   │   ├── Tag 513: JpegOffset (onde começa o JPEG)
│   │   └── Tag 514: JpegLength (tamanho do JPEG)
│   └── Outros metadados
└── JPEG Data (dados reais da imagem)
    ├── SOI (Start of Image)
    ├── SOF0 (Frame Header)
    │   └── Components: número real de componentes
    └── Compressed Data
```

---

## ⚠️ **2. A RAIZ DO PROBLEMA**

### **Inconsistência de Validação:**

```javascript
// PROBLEMA FUNDAMENTAL:
TIFF declara: "Esta imagem tem 2 componentes" (SamplesPerPixel = 2)
JPEG contém: "Na verdade tenho 3 componentes" (SOF0 Components = 3)
```

### **Por que isso é perigoso?**

1. **Alocação de Memória Baseada em TIFF:**
```c
// Código vulnerável (simplificado)
int samples = read_tiff_tag(277);  // Lê 2
buffer = malloc(samples * sizeof(component));  // Aloca para 2
```

2. **Processamento Baseado em JPEG:**
```c
// Mas processa baseado no JPEG
int components = read_jpeg_sof0();  // Lê 3
for (int i = 0; i < components; i++) {  // Loop 3 vezes!
    buffer[i] = process_component(i);   // OVERFLOW no i=2!
}
```

---

## 🔄 **3. FLUXO COMPLETO DA VULNERABILIDADE**

### **Passo a Passo Detalhado:**

```
[1] ABERTURA DO ARQUIVO
    ↓
[2] PARSER TIFF
    ├─→ Lê Header TIFF
    ├─→ Localiza IFD
    ├─→ Lê Tag 277 (SamplesPerPixel = 2)
    └─→ Aloca buffer para 2 componentes
    
[3] LOCALIZAÇÃO DO JPEG
    ├─→ Lê Tag 513 (offset do JPEG)
    └─→ Navega até posição no arquivo
    
[4] PARSER JPEG
    ├─→ Lê marcador SOF0 (0xFFC0)
    ├─→ Extrai número de componentes (3)
    └─→ NÃO VALIDA contra TIFF!
    
[5] PROCESSAMENTO
    ├─→ Loop para processar 3 componentes
    ├─→ Buffer só tem espaço para 2
    └─→ 3º componente escreve FORA do buffer
    
[6] BUFFER OVERFLOW
    ├─→ Sobrescreve dados adjacentes
    ├─→ Pode sobrescrever endereço de retorno
    └─→ Possibilita controle de execução

[7] EXECUÇÃO DE CÓDIGO
    └─→ Atacante controla fluxo do programa
```

---

## 💣 **4. MECÂNICA DO EXPLOIT**

### **Memória Antes do Overflow:**
```
Stack Layout:
+----------------+ ← Topo
| Buffer (2 comp)|  [Componente 0]
|                |  [Componente 1]
+----------------+
| Dados locais   |
+----------------+
| Frame Pointer  |
+----------------+
| Return Address | ← Endereço para retornar
+----------------+
```

### **Memória Durante o Overflow:**
```
Stack Layout:
+----------------+
| Buffer (2 comp)|  [Componente 0]
|                |  [Componente 1]
+----------------+
| Dados locais   |  [Componente 2] ← OVERFLOW!
+----------------+
| Frame Pointer  |  [Sobrescrito]
+----------------+
| Return Address |  [Controlado pelo atacante]
+----------------+
```

---
File Snapshot

[4.0K] /data/pocs/2ee3f69b69acac343ca1504bbae96779b59792ea ├── [3.0K] create-dng_poc_exec.js └── [3.3K] README.md 1 directory, 2 files
Shenlong Bot has cached this for you
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 →