Nginx-UI SSRF Vulnerability via Cluster Node Proxy
Nginx-UI version 2.3.4 and earlier is vulnerable to Server-Side Request Forgery (SSRF) allowing authenticated users to access internal services by manipulating cluster node configurations.
Nginx-UI versions 2.3.4 and earlier contain a Server-Side Request Forgery (SSRF) vulnerability in the cluster node proxy middleware. An authenticated user can exploit this flaw by creating a malicious cluster node that points to an arbitrary internal URL, such as localhost services or cloud metadata endpoints. The vulnerability lies in the lack of validation for the node URL within the internal/middleware/proxy.go file. Successful exploitation allows attackers to bypass network segmentation, access sensitive internal resources, and potentially escalate privileges, especially when combined with other vulnerabilities like njs code injection. This issue allows attackers to reach internal services that should not be exposed.
Attack Chain
- Attacker authenticates to the Nginx-UI web interface.
- Attacker retrieves the
node_secretvia aGETrequest to/api/settings. - Attacker crafts a
POSTrequest to/api/nodesto create a new cluster node. - The crafted node configuration includes a malicious
urlparameter pointing to an internal resource (e.g.,http://127.0.0.1:51820orhttp://169.254.169.254). - Attacker sends an API request (e.g.,
GET /api/settings) with theX-Node-IDheader set to the ID of the newly created malicious node. - The Nginx-UI proxy middleware (
internal/middleware/proxy.go) intercepts the request and forwards it to the attacker-specified internal URL. - The request is executed on the server-side, effectively performing an SSRF attack.
- Attacker gains access to internal resources, cloud metadata, or triggers internal-only njs endpoints.
Impact
Successful exploitation allows an authenticated attacker to access internal services, cloud metadata endpoints, and internal-only njs endpoints. This can lead to the theft of sensitive information such as IAM credentials, port scanning of internal networks, and ultimately, remote code execution and privilege escalation if combined with other vulnerabilities. This vulnerability bypasses network segmentation and firewalls designed to restrict inbound traffic, potentially exposing critical internal resources.
Recommendation
- Deploy the Sigma rule
Detect Nginx-UI SSRF via X-Node-ID Headerto identify requests with theX-Node-IDheader that may indicate SSRF attempts. - Deploy the Sigma rule
Detect Nginx-UI Malicious Node Creationto detect the creation of cluster nodes with suspicious URLs (e.g., internal IPs). - Monitor network connections originating from the Nginx-UI server to internal IPs and cloud metadata endpoints using existing network monitoring tools.
Detection coverage 2
Detect Nginx-UI SSRF via X-Node-ID Header
highDetects potential SSRF attempts in Nginx-UI by monitoring for requests with the X-Node-ID header, indicating the use of the proxy middleware.
Detect Nginx-UI Malicious Node Creation
mediumDetects the creation of cluster nodes with suspicious URLs, such as internal IP addresses, which may indicate an SSRF attempt.
Detection queries are kept inside the platform. Get full rules →
Indicators of compromise
1
ip
| Type | Value |
|---|---|
| ip | 169.254.169.254 |