Unauthenticated dependency inventory + version disclosure via /api/licenses
Description
Privilege required: none - unauthenticated.
GET /api/licenses, /api/licenses/backend, /api/licenses/frontend, and /api/licenses/stats return the full Go-module dependency list and component/version inventory of the running nginx-ui with no authentication. The /licenses group is attached to the bare /api root group, which carries only IPWhiteList() - and that is fail-open when the allowlist is empty (the default).
Details
license.InitRouter(root)(router/routers.go:76) registers the/licensesroutes on the bareroot := r.Group("/api", middleware.IPWhiteList())(router/routers.go:71) - not inside anyAuthRequiredgroup (those are created later, at:91onward).IPWhiteList()(internal/middleware/ip_whitelist.go) returnsc.Next()whensettings.AuthSettings.IPWhiteListis empty (default), so it is not an authentication barrier.GetBackendLicenses()/GetLicenses()(api/license/license.go) return the complete module dependency graph with versions and component metadata.
Proof of concept
curl -s http://<nginx-ui-host>/api/licenses/backend # no auth, no cookie, no tokenReturns the full backend dependency list with versions.
Impact
Pre-auth reconnaissance: an unauthenticated attacker enumerates the exact Go dependency versions and components, pinpointing which known-vulnerable library versions the target ships - a direct aid to picking an n-day. No secrets are exposed, so this is Medium at most, but it is genuinely unauthenticated and exposed on the default config.
Remediation
Move the /licenses routes behind AuthRequired(), or reduce the response to a static license-text bundle without live version/dependency data.
Patches
Fixed in 2.9.1: the /api/licenses* routes moved from the public /api group into the authenticated router group (7e8eb84817).
Workarounds
Configure the IP allowlist, or block /api/licenses at the reverse proxy until you can upgrade.