Ivanti EPMM Pre-Auth RCE via Bash Arithmetic Expansion (CVE-2026-1281 / CVE-2026-1340)
by YunfeiGE18 (lab reproduction of watchTowr Labs research) · 2026-07-05
- Severity
- Critical
- CVE
- CVE-2026-1281, CVE-2026-1340
- Category
- network
- Affected product
- Ivanti Endpoint Manager Mobile (EPMM), map-appstore-url CGI handler
- Affected versions
- Not specified in source (lab reproduces the vulnerable logic rather than a specific shipped version)
- Disclosed
- 2026-07-05
- Patch status
- unpatched
Tags
References
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-05 |
| Last Updated | 2026-02 |
| Author / Researcher | YunfeiGE18 (lab reproduction of watchTowr Labs research) |
| CVE / Advisory | CVE-2026-1281, CVE-2026-1340 |
| Category | network |
| Severity | Critical |
| CVSS Score | Not specified in source |
| Status | PoC |
| Tags | ivanti, epmm, mobileiron, pre-auth-rce, bash, arithmetic-expansion, command-injection, docker-lab |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | Ivanti Endpoint Manager Mobile (EPMM), map-appstore-url CGI handler |
| Versions Affected | Not specified in source (lab reproduces the vulnerable logic rather than a specific shipped version) |
| Language / Platform | Bash (target CGI script), Nginx + fcgiwrap, Docker |
| Authentication Required | No |
| Network Access Required | Yes |
Summary
This is a self-contained Docker/Nginx lab that reproduces the vulnerable Bash logic behind Ivanti EPMM’s pre-auth RCE (as documented by watchTowr Labs). The map-appstore-url CGI script parses comma-separated key=value pairs from a crafted appstore URL in a loop, reusing a shared theValue variable across iterations. By supplying st=theValue (so gStartTime literally becomes the string "theValue") followed by an h= parameter containing gPath[\command`], the script's later Bash arithmetic comparison ([[ … -gt ${gStartTime} ]]) resolves gStartTimeas a variable reference back totheValue, whose content is an array index containing command substitution — triggering arbitrary command execution. The lab includes a test-exploit.sh` harness that verifies file-creation, custom-content, and time-based (sleep) command execution against the dummy target.
Vulnerability Details
Root Cause
Bash’s arithmetic evaluation context ([[ ... -gt ... ]]) treats a variable’s string content as another variable name if it looks like one, and further expands array-style index syntax containing backticks as command substitution — so reusing a loop variable (theValue) across unrelated key parses lets attacker-controlled input flow into an arithmetic/array-index context and execute commands.
Attack Vector
- Send a request to the
map-appstore-urlendpoint with URL path/mifs/c/appstore/fob/3/5/sha256:kid=1,st=theValue%20%20,et=<10-digit>,h=gPath%5B%60COMMAND%60%5D/uuid.ipa. - The
st=theValueparameter (literal string “theValue” padded to 10 characters) setsgStartTime="theValue". - The subsequent
h=gPath[\COMMAND`]parameter sets the loop's sharedtheValue` variable to an array-index expression containing the attacker’s command. - When the script later evaluates
[[ ${currentTime} -gt ${gStartTime} ]], Bash’s arithmetic context resolvesgStartTime→"theValue"→ the attacker’sgPath[\COMMAND`]`, triggering command substitution and executing the injected command as the web server user (root in the lab container).
Impact
Unauthenticated remote code execution on the vulnerable EPMM component, as demonstrated by writing arbitrary files and confirming root-level command output (id returns uid=0(root)) in the lab.
Environment / Lab Setup
Target: Docker container running Nginx + fcgiwrap serving the vulnerable map-appstore-url Bash CGI script (docker-compose up --build -d, exposed on localhost:8180)
Attacker: curl or any HTTP client
Proof of Concept
PoC Script
See
test-exploit.sh,scripts/map-appstore-url,docker-compose.yml,Dockerfile, andnginx.confin this folder.
| |
test-exploit.sh runs a health check, then sends crafted appstore URLs (id > /mi/poc, echo EXPLOITED > /mi/custom, and a sleep 3 timing check) against the dummy target and verifies command execution by inspecting the resulting files and response timing.
Detection & Indicators of Compromise
GET /mifs/c/appstore/fob/*/*/sha256:*st=theValue*h=gPath%5B%60*
Signs of compromise:
- Requests to
map-appstore-url/ appstore endpoints withst=theValue(or similarly crafted 10-character values) combined with backtick/array-index syntax in theh=parameter - Unexpected files or command output written by the web server process (e.g. in EPMM’s data directories)
- Anomalous CGI/nginx process spawning shell children shortly after appstore requests
Remediation
| Action | Detail |
|---|---|
| Primary fix | Apply the Ivanti EPMM security patch addressing CVE-2026-1281 / CVE-2026-1340 (see vendor advisory) |
| Interim mitigation | Restrict network access to the EPMM appstore endpoint, and monitor/alert on requests containing backtick or array-index characters in URL parameters |
References
Notes
Mirrored from https://github.com/YunfeiGE18/CVE-2026-1281-CVE-2026-1340-Ivanti-EPMM-RCE on 2026-07-05.
| |