/

CVE-2026-129171

Severity:

CRITICAL RISK

(9.8)

SQL Injection (CWE-89) in NginxPulse Stats API Endpoint

CVE-2026-129171

Received

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Database disclosure or modification, with potential server file read or write

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

NginxPulse's stats API contains an unauthenticated SQL injection vulnerability involving the id and locationType parameters. A remote attacker may be able to read or modify database data and, where PostgreSQL superuser functions are available, access server files.

Affected context

The issue occurs in NginxPulse's /api/stats/:type endpoint when it processes the id and locationType parameters in SQL queries. Risk arises when parameter values are incorporated into SQL, including a quoted table-name identifier, without safe query construction and appropriate validation. The described attack does not require authentication.

Exploit preconditions

  • Attack surface: Network-accessible NginxPulse stats API
  • Required access: No authentication is required, according to the vulnerability description
  • Trigger point: Request handling for /api/stats/:type, where id or locationType is used
  • Why exploitation is possible: User-controlled values can alter the intended SQL query; database-level file operations additionally depend on PostgreSQL privileges and configuration

Why this happens

The underlying issue is unsafe construction of SQL using attacker-controlled parameter values, including a table-name identifier. If input is concatenated or quoted incorrectly rather than handled through safe query-building patterns, it can change the meaning of the query. This is CWE-89: SQL Injection. Error-based query behavior may expose data, while file access depends on the database's available privileges and functions.

Potential impact

  • Attackers may read sensitive database contents.
  • Attackers may alter or delete database records, depending on query behavior and privileges.
  • PostgreSQL superuser functions may allow reading or writing server files where available.
  • Database or application availability may be affected by unauthorized queries or changes.

General mitigation guidance

Mitigation generally centers on preventing untrusted values from changing SQL structure.

  • Use parameterized queries for data values and safe, allowlisted mappings for identifiers such as table names, which generally cannot be bound as ordinary query parameters.
  • Validate inputs against expected types, formats, and permitted values as an additional control.
  • Avoid returning detailed database errors to unauthenticated clients.
  • Restrict database accounts to the minimum privileges required; avoid granting application connections superuser capabilities or unnecessary file-operation permissions.
  • Reduce exposure of sensitive API operations through appropriate access controls and network boundaries.

How teams detect issues like this

  • Use static analysis to identify SQL strings assembled from request parameters, especially around identifier quoting and query-building code.
  • Review the stats endpoint and its data-access layer for unsafe concatenation, dynamic identifiers, and database error handling.
  • Monitor for unusual requests to the endpoint, SQL errors, unexpected database reads or writes, and use of PostgreSQL file-operation functions.
  • Apply policies requiring parameterized queries and approved allowlists for dynamic SQL identifiers; automated code review tools may help identify risky patterns.

Sources

SourceLink
github.comgithub.com/likaia/nginxpulse/blob/0d41264ae441ddfcb595551f2e2f374f707dae22/internal/analytics/overall_stats.go#L219-L224
github.comgithub.com/likaia/nginxpulse/blob/0d41264ae441ddfcb595551f2e2f374f707dae22/internal/analytics/stats.go#L217-L221
github.comgithub.com/likaia/nginxpulse/commit/f9416bea3be892a394cd24a6d4a2afbd8397e926
github.comgithub.com/likaia/nginxpulse/issues/103
vul.yulun.ac.cnvul.yulun.ac.cn/20261030/nginxpulse/
vulncheck.comvulncheck.com/advisories/nginxpulse-1.5.0-before-1.6.26-sql-injection-via-api-stats-type

Frequently asked

questions

Yes. The description identifies a network-accessible API endpoint and states that authentication is not required.

No application authentication is required, but the endpoint must be reachable. The potential for server file access also depends on PostgreSQL privileges and configuration.

Keep user-controlled input from defining SQL structure: use parameterized queries for values and strict allowlists for dynamic identifiers.

Establish secure query-building standards, review dynamic SQL paths, validate inputs, limit database privileges, and monitor for suspicious query activity.

Find out what's already
exploitable in your codebase.