
Image: NginxPulse dashboard, official project screenshot from github.com/likaia/nginxpulse (MIT).
NginxPulse: Upgrade to 1.6.26 — an Unauthenticated SQL Injection in Your Log Dashboard
Evidence: LAB_VERIFIED for the tested parts — lab run 2026-11-21/22. The upgrade 1.6.24 → 1.6.26, the access-key gating, the privilege split, and the before/after behaviour of the injection below were verified in an isolated lab (official images run in a chroot sandbox, loopback only, outputs captured). RESEARCH_ONLY for one point: remote code execution via
session_preload_librarieswas never demonstrated in the lab — the reporter states it is possible, and this article does not present it as demonstrated. See Verification scope.
The question
You run NginxPulse — the open-source nginx access-log analytics dashboard — on your own server, and its stats API has an unauthenticated SQL injection that can read files on that server. Are you affected, and what exactly do you do about it?
The decision up front: upgrade to 1.6.26 — the only fixed release. If you cannot upgrade today, set system.accessKeys now: it blocks anonymous exploitation, but it is a mitigation, not the fix. Do not rely on access keys alone.
What the flaw is
CVE-2026-129171 is an unauthenticated SQL injection (CWE-89) in GET /api/stats/:type (CVSS 4.0 9.3, CVSS 3.1: 9.8). Two request parameters are interpolated into SQL without validation: id is inserted as a quoted table-name identifier, and locationType is inserted directly as a column name. Closing the quote in id lets an attacker append SQL, and PostgreSQL writes the failed value into the error message — which the API returns in the HTTP response.
It affects NginxPulse 1.5.0 and later, up to but not including 1.6.26 — including 1.6.25, which is affected even though the original report only tested through 1.6.24. The fix is 1.6.26 (commit f9416bea, released 2026-11-04). The vulnerability was disclosed on 2026-10-30 (GitHub issue #103) and the CVE record was published on 2026-11-13.
The flaw is not in CISA’s Known Exploited Vulnerabilities catalog, and there is no confirmed in-the-wild exploitation as of 2026-11-21. A public proof of concept exists (the report in issue #103 itself). CISA’s SSVC assessment of 2026-11-18 rates exploitation as “poc”, automatable “yes”, and technical impact “total”. EPSS is 0.41%.
Why it is severe: the database runs as superuser
In affected versions the official Docker image bundles PostgreSQL initialized with initdb --username=nginxpulse, and the application connects as that cluster superuser. With superuser, the injection can call pg_read_file and the large-object functions — reading and writing server files, not just database rows. The original report demonstrated reading /etc/passwd this way, chunk by chunk, through the error channel.
The reporter also states that remote code execution is possible via session_preload_libraries. That is a stated possibility, not a demonstrated exploit: the published report demonstrates only the file read. This article does not claim RCE was demonstrated.
The same commit that fixes the injection also reduces the blast radius: the embedded PostgreSQL startup now separates an administrator role (POSTGRES_ADMIN_USER, default nginxpulse_admin) from the application role, so the application no longer runs as superuser. The lab verified this split after the upgrade (see below).
Step 1: check whether you are affected
The reliable check is the version endpoint. From the machine running NginxPulse:
curl -s http://127.0.0.1:8089/api/version
If access keys are already configured, add your key header (see Step 2). Affected versions report v1.6.25 or older; fixed versions report v1.6.26. The lab’s 1.6.24 instance reported {"git_commit":"0d41264","version":"v1.6.24"}.
You can also check the image tag you deployed. The fixed release is published as magiccoders/nginxpulse:v1.6.26 — note the v prefix — and latest currently points to 1.6.26. If you are running any 1.5.x or 1.6.x image older than that, you are affected.
Step 2: mitigate now if you cannot upgrade today
Set access keys in configs/nginxpulse_config.json (system.accessKeys, a list — empty by default) or via the ACCESS_KEYS environment variable. Once at least one key is configured, every request under /api/ must carry a valid key in the X-NginxPulse-Key header; requests without a key, or with a wrong key, get HTTP 401. The lab confirmed this on 1.6.24:
| Request | Result |
|---|---|
| No key | 401 {"error":"需要访问密钥"} (“access key required”) |
| Wrong key | 401 {"error":"访问密钥无效"} (“access key invalid”) |
| Correct key | 200, stats as normal |
Two things to know: the frontend on port 8088 is not gated by this middleware — only /api/ paths are — and keys expire after 7 days by default (accessKeyExpireDays). This blocks anonymous exploitation of the stats endpoint, which is exactly the workaround named in the original report. It is not the fix: upgrade to 1.6.26 remains required.
Step 3: upgrade to 1.6.26
Back up your data first. The fix commit’s own deployment notes require a backup of pgdata before upgrading, and the lab backed up pgdata and nginxpulse_data before running the upgrade. Stop the container so PostgreSQL shuts down cleanly (a stop_grace_period of 90 seconds is recommended in Compose), copy the mounted pgdata directory somewhere safe, then pull the new image and restart:
docker compose down
cp -a /path/to/pgdata /path/to/pgdata-backup
docker compose pull
docker compose up -d
Substitute the actual host paths of your /app/var/pgdata mount (the image also requires /app/var/nginxpulse_data mounted, or the container exits with an error). If you pin the image tag, pin v1.6.26, not latest.
One configuration rule from the fix: POSTGRES_ADMIN_USER must differ from POSTGRES_USER. If you run an external PostgreSQL via DB_DSN, your external accounts need no changes — the migration never renames, demotes, or changes external roles.
The upgrade itself ran cleanly in the lab on the same pgdata: the migration renamed the old bootstrap superuser to nginxpulse_admin, recreated nginxpulse as an ordinary role, and transferred ownership of 19 tables and 8 sequences. After the upgrade, /api/version reported v1.6.26 (git f9416be), /api/status reported migration_required:false, and the stats data was identical to the pre-upgrade baseline.
Step 4: verify the fix
Run the same benign check the lab used: append a single double-quote to your own website ID. This is not a payload — it is one quote character, and it only tests whether the input reaches SQL at all.
curl -s -H "X-NginxPulse-Key: <your-key>" \
"http://127.0.0.1:8089/api/stats/overall?id=<your-website-id>%22&timeRange=7d"
Omit the header if you have no access keys configured. On an affected version the API returns a PostgreSQL error (unterminated quoted identifier, SQLSTATE 42601) — the lab observed exactly that on 1.6.24. On 1.6.26 the request is rejected before any SQL is built: HTTP 400 with {"error":"站点不存在"} (“site does not exist”), because validateWebsiteID() rejects the unknown website ID first. If you see the PostgreSQL error, you are still on an affected version.
Then confirm the privilege split took effect. Query the roles as the admin user: nginxpulse must be an ordinary role (no superuser, no createdb, no createrole, no replication, no bypassrls) and nginxpulse_admin the superuser, with the database and its objects owned by nginxpulse. In the lab, all 83 application-schema objects were owned by the application role after the upgrade.
What else changed in 1.6.26
locationTypeis now allowlisted todomestic,city, andglobalonly; anything else is rejected.validateWebsiteID()rejects any website ID that is not in the configured sites, soidcan no longer smuggle SQL through the table-name identifier.- The embedded PostgreSQL is 17.11 in the 1.6.26 image (17.9 in 1.6.24), verified from the startup log in the lab. For external databases, PostgreSQL 16 remains the documented recommendation.
- The fix commit also added security regression tests (
scripts/test_security.sh) covering both injections, HTTP error redaction, fresh installs, legacy upgrades, and ordinary-role operations.
A note on rollback
The upstream deployment notes warn against switching back to an old image after the migration, because the old entrypoint depends on the application’s database-creation privilege, which the migration removes. The lab observed something narrower: a plain restart of the 1.6.24 image on a copy of the migrated data started and served requests normally, because the database already existed and the old entrypoint skipped the creation step. That is an observation on a copy, not a safety claim. It was not tested for the case where the database must be recreated, or after the new version writes a new schema. Back up pgdata before upgrading, and do not plan on rolling back.
Limitations
- Remote code execution via
session_preload_librariesis RESEARCH_ONLY: the reporter states it is possible, but it was never demonstrated in the published report and was never reproduced in this lab. This article does not present it as demonstrated. - The 1.6.26 release date is verified from the release page: v1.6.26 was released 2026-11-04 11:10 (tag v1.6.26, commit f9416be). Only the 1.6.24 release date remains unverified, so no release date is stated for 1.6.24.
- Rollback was observed only as a plain restart on a copy of migrated data; rollback after a database recreation or a new-schema write was not tested.
- There is no formal support matrix or end-of-life policy published for NginxPulse. The only supported path in practice is the latest release (1.6.26). The project has a single maintainer, and the README notes most of the project was generated with Codex.
- KEV status was verified directly against the CISA KEV feed (catalog v2026.11.20): CVE-2026-129171 is not in the catalog. SSVC status was corroborated across CVE aggregators citing CISA, not read directly on a CISA page; re-check at publish time.
- NginxPulse is an independent open-source project by likaia, unrelated to F5/NGINX Inc. — it is not “the official nginx analytics tool”. It is also unrelated to NGINX2Shell (CVE-2026-123633), which is a flaw in nginx’s HTTP/2 stack, not in this analytics application.
Verification scope
Check date: 2026-11-21. Lab run 2026-11-21/22 (two sessions: 2026-11-21 ~17:05–18:08 UTC and 18:10–18:30 UTC), isolated sandbox on loopback only. Docker cannot run containers on this VM (the environment blocks creating network namespaces), so the lab ran the official images in a chroot sandbox from the extracted images, with outputs captured. Observed and recorded: the Docker Hub tag v1.6.26 exists (with the v prefix) and latest points to 1.6.26; embedded PostgreSQL 17.9 in 1.6.24 and 17.11 in 1.6.26; the SQL injection present on 1.6.24 (benign " in id returned a PostgreSQL error, SQLSTATE 42601) and fixed on 1.6.26 (same input returned HTTP 400, no PostgreSQL error); access-key gating on 1.6.24 (401 without a key, 401 with a wrong key, 200 with the correct key; frontend not gated) and still enforced after the upgrade; the upgrade 1.6.24 → 1.6.26 on the same pgdata (migration completed: role rename and privilege split, 19 ALTER TABLE + 8 ALTER SEQUENCE, data preserved); the privilege split (nginxpulse demoted, nginxpulse_admin superuser, 83 objects owned by the application role); and a plain restart of 1.6.24 on a copy of the migrated data working, with the caveats above. Not lab-tested: file read / RCE via session_preload_libraries (U-01); rollback when the database must be recreated.
For the same check-and-upgrade pattern on other self-hosted software, see NGINX2Shell CVE-2026-123633 and Apache HTTP/2 CVE-2026-119618. For self-hosting in general, see Coolify.
References
- NVD CVE-2026-129171 — https://nvd.nist.gov/vuln/detail/CVE-2026-129171
- VulnCheck advisory — https://www.vulncheck.com/advisories/nginxpulse-1.5.0-before-1.6.26-sql-injection-via-api-stats-type
- Original report, GitHub issue #103 — https://github.com/likaia/nginxpulse/issues/103
- Root-cause analysis (Wu Yulun) — https://vul.yulun.ac.cn/20261030/nginxpulse/
- Fix commit f9416bea — https://github.com/likaia/nginxpulse/commit/f9416bea3be892a394cd24a6d4a2afbd8397e926
- Release v1.6.26 — https://github.com/likaia/nginxpulse/releases/tag/v1.6.26
- NginxPulse on Docker Hub — https://hub.docker.com/r/magiccoders/nginxpulse
- NginxPulse repository (MIT) — https://github.com/likaia/nginxpulse
Bình luận
Bình luận được duyệt trước khi hiển thị.Đang tải bình luận…
Để lại bình luận