Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-42220 — nginx-ui

🟡 CVSS 6.5 — Medium ✅ No Known Exploit CWE-200 NVD
6.5
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Nginx-UI: Authenticated settings disclosure exposes node.secret and enables trusted-node authentication abuse, backup exfiltration, and restore-based nginx-ui state rollback

Summary

An authenticated user can call GET /api/settings and retrieve sensitive configuration values, including node.secret. The same node.secret is accepted by AuthRequired() through the X-Node-Secret header (or node_secret query parameter), causing the request to be treated as authenticated via the trusted-node path and associated with the init user.

In my local reproduction on v2.3.6, GET /api/settings also returned app.jwt_secret. After extracting node.secret, I was able to access GET /api/backup using only X-Node-Secret, download a full backup archive, and obtain the X-Backup-Security response header containing the backup decryption material (AESKey:AESIv).

I also confirmed that the disclosed node.secret is sufficient to reach the restore workflow on an installed instance. Using only X-Node-Secret, a valid backup archive, and its matching X-Backup-Security token, I successfully invoked POST /api/restore. In a follow-up rollback test, I changed node.name to rollback-poc-B, then restored a previously captured backup and observed the value revert to its original state. This extends the issue beyond secret disclosure and backup exfiltration into confirmed integrity impact through restore-based rollback of nginx-ui state/configuration.

This breaks the trust boundary between ordinary user-authenticated API access and the internal node-authentication mechanism, and results in sensitive configuration disclosure, alternate-authentication abuse, backup exfiltration with decryption material, and confirmed restore-based rollback of nginx-ui state.

Details

Vulnerable code / related files and functions

1) Route exposure and insufficient protection on the read path

File: api/settings/router.go

Relevant function: InitRouter

The settings router exposes the following endpoints:

```http

GET /api/settings/server/name → GetServerName

GET /api/settings → GetSettings

POST /api/settings → RequireSecureSession(), SaveSettings

```

The key issue is that the read path (GET /api/settings) is only protected by the generic authentication middleware, while the write path (POST /api/settings) has an additional RequireSecureSession() check. This makes the read path a much easier place to leak sensitive configuration data than the write path.

```go

r.GET("settings/server/name", GetServerName)

r.GET("settings", GetSettings)

r.POST("settings", middleware.RequireSecureSession(), SaveSettings)

```

2) Sensitive data is disclosed by GetSettings

File: api/settings/settings.go

Relevant functions: GetSettings, SaveSettings

GetSettings returns multiple configuration objects directly in the JSON response, including app, server, database, auth, casdoor, oidc, cert, http, logrotate, nginx, node, openai, terminal, and webauthn. In other words, the handler does not use a redacted DTO for user-facing output; it serializes the live settings objects directly.

```go

c.JSON(http.StatusOK, gin.H{

"app": cSettings.AppSettings,

"server": cSettings.ServerSettings,

"database": settings.DatabaseSettings,

"auth": settings.AuthSettings,

"casdoor": settings.CasdoorSettings,

"oidc": settings.OIDCSettings,

"cert": settings.CertSettings,

"http": settings.HTTPSettings,

"logrotate": settings.LogrotateSettings,

"nginx": settings.NginxSettings,

"node": settings.NodeSettings,

"openai": settings.OpenAISettings,

"terminal": settings.TerminalSettings,

"webauthn": settings.WebAuthnSettings,

})

```

In my local reproduction on v2.3.6, this response exposed both:

```

node.secret

app.jwt_secret

```

This makes GetSettings the direct disclosure source for the vulnerability.

3) The disclosed value is explicitly defined as protected/sensitive

File: settings/node.go

Relevant object: type Node

The Node settings object defines the following field:

```go

type Node struct {

Name string json:"name" binding:"omitempty,safety_text"

Secret string json:"secret" protected:"true"

...

}

```

The protected:"true" tag shows that the codebase itself treats node.secret as a protected/sensitive value. Despite that, the field is still returned unredacted by GetSettings. This strongly indicates a real secret disclosure issue rather than a harmless configuration read.

4) The disclosed secret is reused as an authentication credential

File: internal/middleware/middleware.go

Relevant functions: getNodeSecret, AuthRequired, AuthRequiredWS

The authentication middleware contains a separate node-secret authentication path:

  • getNodeSecret(c) reads the value from the X-Node-Secret header or the node_secret query parameter.
  • AuthRequired() checks whether the supplied value equals settings.NodeSettings.Secret.
  • If it matches, the middleware:

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs low-level privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality high, integrity none, availability none.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: Low — an ordinary user account is enough.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Unchanged — the damage stays inside the vulnerable component.
  • Confidentiality impact: High — total loss, or loss the attacker controls.
  • Integrity impact: None.
  • Availability impact: None.

Weakness class

CVE-2026-42220 is classified as CWE-200: Exposure of Sensitive Information. Information that should stay internal is disclosed to someone who is not authorised to see it.

Affected software

CVE-2026-42220 is recorded against 2 packages.

  • github.com/0xjacky/nginx-ui
  • nginx-ui (fixed in 2.3.8)

Timeline and source

Published on 25 June 2026 and last revised on 21 July 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.

References

github.com (Advisory)
nvd.nist.gov (Advisory)
github.com (Web)

Other advisories for this package

github.com/0xjacky/nginx-ui has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-200: Exposure of Sensitive Information) in other software:

Details

Severity Medium
CVSS Score 6.5
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
CWE CWE-200
Public Exploit ✅ No
Source NVD
Published 2026-06-25
Updated 2026-08-20
Modified 2026-07-21
Fix URL N/A

Affected Packages

Software From version Fixed in
github.com/0xjacky/nginx-ui
nginx-ui 2.3.8

Similar Threats

Vulnerability Monitoring

Track new vulnerabilities in nginx-ui

CVE-2026-42220 is rated CVSS 6.5 Medium. BotEraser monitors your WordPress installation and notifies you when software you use appears in our vulnerability database.

Set Up Free Alerts →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026