Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-42223 — nginx-ui

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

Description

Nginx-UI Settings API Exposes Protected Secrets

Summary

The GetSettings API handler (api/settings/settings.go:24-65) serializes all settings structs to JSON and returns them to authenticated users. Many sensitive fields are tagged with protected:"true" - however, this tag is only enforced during writes (via ProtectedFill in SaveSettings) and is completely ignored during reads. This exposes 40+ protected fields including JwtSecret (enabling auth token forgery), NodeSecret (enabling cluster node impersonation), OIDC ClientSecret (enabling OAuth account takeover), and the IP whitelist configuration.

Details

Vulnerable Code

api/settings/settings.go:49-64 - GetSettings serializes all fields

```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,

})

```

Go's json.Marshal serializes all exported fields with json: tags. The protected:"true" struct tag is a custom tag - it has no effect on JSON serialization.

Protection is Write-Only

api/settings/settings.go:126-135 - ProtectedFill only used during saves

```go

cSettings.ProtectedFill(cSettings.AppSettings, &json.App)

cSettings.ProtectedFill(cSettings.ServerSettings, &json.Server)

cSettings.ProtectedFill(settings.AuthSettings, &json.Auth)

// ... etc

```

ProtectedFill prevents overwriting protected fields during SaveSettings, but GetSettings has no corresponding filter. The protection is asymmetric - secrets can be read but not overwritten.

Exposed Protected Fields

settings/node.go:

  • Secret (protected) - used for cluster node authentication
  • SkipInstallation (protected), Demo (protected)

settings/oidc.go (all protected):

  • ClientId, ClientSecret, Endpoint, RedirectUri, Scopes, Identifier

settings/casdoor.go (all protected):

  • Endpoint, ExternalUrl, ClientId, ClientSecret, CertificatePath, Organization, Application, RedirectUri

settings/auth.go:

  • IPWhiteList (protected) - exposes security configuration

Attack Scenario

1. Low-privilege authenticated user calls GET /api/settings

2. Response includes NodeSecret - attacker can impersonate cluster nodes

3. Response includes OIDC ClientSecret - attacker can perform OAuth flows as the application

4. Response includes IPWhiteList - attacker learns network security configuration

5. If JwtSecret is in app settings (via cosy framework), attacker can forge authentication tokens for any user

PoC

1. GetSettings serializes all fields without filtering protected:"true" tags. From api/settings/settings.go:49-64:

```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,

})

```

Go's json.Marshal serializes all exported fields. The custom protected:"true" tag has no effect on serialization.

2. Protected secrets are defined across settings/*.go. High-impact examples:

```go

// settings/server_v1.go:19

JwtSecret string json:"jwt_secret" protected:"true"

// settings/node.go:5

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

// settings/oidc.go

ClientSecret string json:"client_secret" protected:"true"

// settings/auth.go

IPWhiteList []string json:"ip_white_list" protected:"true"

```

3. ProtectedFill is write-only. It appears 10 times in SaveSettings (lines 126-135) but 0 times in GetSettings:

```go

// api/settings/settings.go:126-135 - Only used during writes

cSettings.ProtectedFill(cSettings.AppSettings, &json.App)

cSettings.ProtectedFill(cSettings.ServerSettings, &json.Server)

cSettings.ProtectedFill(settings.AuthSettings, &json.Auth)

// ... 7 more calls

```

4. Exploit request. Any authenticated user can retrieve all secrets:

```http

GET /api/settings HTTP/1.1

Authorization: Bearer <any-valid-jwt>

```

Response includes (among 45 protected fields):

```json

{

"app": {"jwt_secret": "<the-actual-jwt-signing-key>", ...},

"node":

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-42223 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-42223 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. 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-06-25
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-42223 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