CVE-2026-129171: NginxPulse SQL injection allows unauthenticated database and file access

NginxPulse before 1.6.26 fails to validate the 'id' and 'locationType' parameters in the /api/stats API endpoint, allowing unauthenticated SQL injection that can dump databases and read or write server files via PostgreSQL superuser functions. This scores CVSS 9.8.

Share

NginxPulse is a monitoring or analytics tool that exposes a REST API endpoint /api/stats/:type for retrieving statistics. The endpoint accepts 'id' and 'locationType' query parameters without proper input validation or parameterized queries, leading to classic SQL injection. Because PostgreSQL is the backing database and the application may run with superuser privileges, attackers can not only exfiltrate all database contents but also abuse PostgreSQL's file read/write functions to compromise the server filesystem.

CVECVE-2026-129171
SeverityCritical (CVSS 9.8)
Actively exploitedNot confirmed at time of writing

How the attack works

When a client requests /api/stats/:type with user-supplied values for 'id' and 'locationType', the application constructs an SQL query by concatenating these parameters directly into the WHERE clause or table identifier, without escaping or parameterization. An attacker can close the quoted table name identifier with a quote character and append arbitrary SQL clauses. Using error-based SQL injection techniques, the attacker can extract database contents by triggering errors that leak data. If the database connection runs with superuser privileges, PostgreSQL functions like `pg_read_file()` and `COPY ... TO/FROM` can be abused to read arbitrary files from the server or write PHP shells to web-accessible directories.

Who is affected

Organizations running NginxPulse versions 1.5.0 through 1.6.25. The vulnerability is unauthenticated and remotely exploitable, affecting any NginxPulse instance exposed to the network.

How to check if you're exposed

  • Identify NginxPulse instances in your environment by scanning for the /api/stats endpoint or searching for known NginxPulse ports and application signatures
  • Check version numbers by reviewing NginxPulse application metadata, logs, or configuration files
  • Review access logs for requests to /api/stats with suspicious 'id' or 'locationType' parameters containing SQL keywords, quotes, or semicolons
  • Query database audit logs (if enabled) for unexpected or anomalous SQL queries, particularly those accessing system tables or executing file I/O functions

How to fix it

  • Update NginxPulse to version 1.6.26 or later, which includes input validation and parameterized queries for the stats API
  • Review database credentials and revoke unnecessary superuser privileges from the NginxPulse database connection
  • Audit database contents and filesystem for signs of data exfiltration or unauthorized file writes
  • Implement Web Application Firewall (WAF) rules to block requests with SQL injection payloads in API parameters

If you can't patch yet

  • Restrict network access to the /api/stats endpoint to trusted internal IPs only using firewall rules or reverse proxy authentication
  • Run the NginxPulse database connection with minimal required privileges; create a dedicated read-only database user if possible
  • Monitor API logs and database queries for suspicious SQL patterns and alert on any queries containing file I/O functions

Need help checking your exposure or patching at scale? FutureOps InfoTech can help.

Read more