CVE-2023-30805
Critical · 9.8CVSS
9.8
EPSS
65.0%
Published
Oct 10, 2023
CISA due date
—
Cloudanix analysis
A vulnerable firewall login page can let an outside attacker take control of the device and use it as a gateway into the network.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Remote Code Execution
- Component
- Network Service
- Class
- Command Injection
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Medium
What it actually does
The flaw is an unauthenticated operating system command injection in the Sangfor Next-Gen Application Firewall NGAF8.0.17 login/logout endpoint. The vulnerable code passes the HTTP POST parameter "un" from /LogInOut.php into shell execution without correctly neutralizing shell metacharacters. Because the issue is remotely reachable, requires no authentication, and can execute attacker-controlled commands in the appliance operating system context, successful exploitation can provide full confidentiality, integrity, and availability impact, including command execution, file modification, credential theft, persistence, lateral movement staging, or service disruption.
Why it matters to the business
A vulnerable internet-facing firewall can become an attacker-controlled entry point into the network. Compromise of a perimeter security device can allow traffic interception, credential harvesting, disruption of access controls, deployment of malware, and pivoting into internal systems. The high CVSS score, available exploit maturity, and high EPSS probability indicate this should be treated as urgent even though it is not currently listed in CISA KEV and is not marked as ransomware-associated. The supplied affected-package metadata references Spring Security artifacts and fixed versions, which does not align with the Sangfor NGAF vulnerability description; organizations should verify product applicability against authoritative vendor advisories before closing remediation.
How an attack unfolds
An attacker identifies a Sangfor NGAF instance exposing the vulnerable web interface and sends a crafted unauthenticated HTTP POST request to /LogInOut.php. The request places shell metacharacters or command separators in the "un" parameter so that, when the application handles the parameter, unintended operating system commands are interpreted by the underlying shell. The attacker typically begins with a low-impact command to confirm execution, then uses the same primitive to download tooling, modify files, create persistence, extract configuration or credentials, and use the firewall as a foothold for internal reconnaissance. Because the target is a security appliance, attackers may also attempt to disable logging, alter access rules, or proxy traffic through the device to obscure later activity.
How to fix it
Upgrade affected Sangfor NGAF appliances to a vendor-supported fixed release or apply the vendor-provided security hotfix for NGAF8.0.17 as soon as possible. If an immediate upgrade is not possible, restrict access to the web management interface to trusted administrative networks only, block public access to /LogInOut.php at upstream controls where operationally safe, enforce VPN or jump-host access for management, and monitor for suspicious POST requests containing shell metacharacters in the "un" parameter. Review device configuration for unauthorized changes after patching. The supplied package metadata also lists Spring Security fixed versions org.springframework.security:spring-security-core 6.1.7 and 6.2.2, and Git commit dd5bfc0b3126a33c574354adf8d71fd4b34175ba; because this does not match the Sangfor NGAF description, validate whether those package fixes are relevant to a separate dependency finding before applying them as remediation for this appliance issue.
How to confirm the fix worked
Confirm the appliance version is no longer NGAF8.0.17 or that the vendor hotfix for this issue is installed. Validate that the management interface is not reachable from untrusted networks and that /LogInOut.php is not externally accessible except through approved administrative paths. Review web access logs or reverse-proxy logs to ensure suspicious requests to /LogInOut.php are no longer accepted. If safe and authorized, use a non-destructive vulnerability scanner or vendor-provided verification check that confirms the "un" parameter is no longer interpreted by the operating system shell. For software dependency inventories, separately confirm whether any Spring Security usage has been upgraded to spring-security-core 6.1.7, 6.2.2, or a later fixed branch if that package finding is applicable.
Typical attack path
- Discover exposed Sangfor NGAF web management or login interface through scanning, search engines, or prior reconnaissance.
- Send an unauthenticated HTTP POST request to /LogInOut.php with a crafted "un" parameter containing shell metacharacters.
- Confirm command execution through response behavior, timing, DNS callbacks, or outbound HTTP callbacks.
- Execute follow-on commands to enumerate the appliance, user context, network interfaces, routes, and stored configuration.
- Download or stage additional tools such as shells, tunneling utilities, malware, or credential collection scripts.
- Establish persistence, modify firewall or web files, create scheduled tasks or startup scripts, or install unauthorized services where possible.
- Use the compromised appliance to intercept traffic, pivot to internal systems, or disrupt network availability.
- Attempt to delete logs, rotate traces, or blend activity into normal web requests to avoid detection.
How to detect it
Investigate web access logs, appliance management logs, WAF logs, reverse-proxy logs, EDR telemetry where available, DNS logs, proxy logs, and firewall egress logs. Focus on unauthenticated POST requests to /LogInOut.php, especially requests with a "un" parameter containing command separators, pipes, backticks, subshell syntax, URL-encoded metacharacters, or common system command names. Look for evidence of command-execution validation such as ping, nslookup, curl, wget, sleep, id, uname, whoami, or DNS/HTTP callbacks shortly after a request. On the appliance, review recently modified web files, startup scripts, cron entries, temporary directories, unauthorized binaries, abnormal child processes spawned by the web service, new users, modified firewall rules, and unexplained outbound connections. Correlate suspicious requests with subsequent configuration changes, service restarts, unusual administrative logins, or traffic to command-and-control infrastructure.
- POST /LogInOut.php
- /LogInOut.php
- un=
- un=%3B
- un=%7C
- un=%26
- un=%60
- un=$(
- ;wget
- ;curl
- |wget
- |curl
- `wget
- `curl
- /bin/sh
- /bin/bash
- bash -c
- sh -c
- busybox
- chmod +x
- /tmp/
- /var/tmp/
- /dev/shm/
- whoami
- uname -a
- id;
- nslookup
- ping -c
- nc -e
- netcat
- telnetd
What your security team should do
- Treat exposed Sangfor NGAF8.0.17 appliances as high-priority assets for emergency patching or isolation because remote unauthenticated command execution is possible and exploit code is available.
- Immediately restrict management-plane access to trusted IP ranges, VPNs, or administrative jump hosts; remove public internet exposure where possible.
- Search historical web, WAF, reverse-proxy, and appliance logs for POST requests to /LogInOut.php containing shell metacharacters in the "un" parameter.
- Perform compromise assessment on vulnerable appliances before and after patching, including file integrity review, process review, persistence checks, configuration diffing, and outbound connection analysis.
- Rotate credentials, API keys, VPN secrets, and administrative passwords stored on or passing through any appliance suspected of compromise.
- Review firewall policies, NAT rules, user accounts, scheduled tasks, startup scripts, and web directories for unauthorized changes.
- Block or alert on outbound appliance connections to unusual destinations, especially HTTP/HTTPS downloads, DNS callbacks, reverse shells, and tunneling traffic.
- Validate whether the Spring Security fixed-version metadata in the input represents a separate dependency exposure and remediate it independently if present.
The record
The Sangfor Next-Gen Application Firewall version NGAF8.0.17 is vulnerable to an operating system command injection vulnerability. A remote and unauthenticated attacker can execute arbitrary commands by sending a crafted HTTP POST request to the /LogInOut.php endpoint. This is due to mishandling of shell meta-characters in the "un" parameter.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|
Related vulnerabilities
- CVE-2026-96376 Improper Neutralization of Special Elements used in an OS Command ("OS Command… CWE-78
- CVE-2026-113732 virtualenv is a tool for creating isolated virtual python environments. CWE-78
- CVE-2026-113776 virtualenv is a tool for creating isolated virtual python environments. CWE-78
- CVE-2026-113726 virtualenv is a tool for creating isolated virtual python environments. CWE-78
- CVE-2026-113725 virtualenv is a tool for creating isolated virtual python environments. CWE-78
- CVE-2026-113722 virtualenv is a tool for creating isolated virtual python environments. CWE-78
- CVE-2026-112943 launch-editor allows users to open files with line numbers in editor from Node.js. CWE-78
- CVE-2026-112900 Pillow is a Python imaging library. CWE-78