CVE-2026-47722: nebula-mesh: Host advanced overrides allow YAML injection into agent config.yml
internal/configgen/generator.go:86,108,119 interpolates the operator-supplied ListenHost and TunDevice fields raw into a text/template that produces the agent's config.yml. internal/web/advanced.go:20-35 accepts both with only strings.TrimSpace — no character or shape validation.
Published Jun 8, 2026
Affected packages
github.com/juev/nebula-mesh
- Ecosystem
- Go
- Affected
- < 0.3.2
- Fixed in
- 0.3.2
- Check
go list -m github.com/juev/nebula-mesh
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
internal/configgen/generator.go:86,108,119 interpolates the operator-supplied ListenHost and TunDevice fields raw into a text/template that produces the agent's config.yml. internal/web/advanced.go:20-35 accepts both with only strings.TrimSpace — no character or shape validation.
Exploit
An operator (or attacker with any operator key, given the cross-tenant CRUD advisory) sets adv_tun_device to:
nebula0
lighthouse:
am_lighthouse: true
hosts: ["10.0.0.1"]
#The agent fetches the rendered config on its next signed poll. On config reload, it loads the injected YAML keys: the host self-promotes to lighthouse, attracts mesh traffic, or sets am_relay: true to be selected as a relay. The ListenHost field has the same shape.
Affected
All released versions prior to v0.3.2.
Threat model
- Today: operator can compromise their own host's config (trivially allowed if they own the host, but they can also set lighthouse/relay flags that the operator-create form does NOT expose — privilege uplift within their own tenant).
- Combined with the critical /api/v1 authz advisory: any operator key can mutate ANOTHER tenant's host overrides and inject YAML there.
- Post-fix of the authz advisory: still relevant — the agent unconditionally trusts whatever config the server hands it, so any future operator-impersonation bug re-amplifies this.
Suggested fix
Two options, either acceptable:
- Input validation in
parseAdvancedFromForm(internal/web/advanced.go): ListenHost: regex^[A-Za-z0-9.:\[\]_-]+$(IPv4/IPv6/hostname)TunDevice: regex^[A-Za-z0-9_-]{1,15}$(Linux IFNAMSIZ caps at 15) Reject invalid input with a form-level error; do not write to the host row.
- Safer marshalling: switch
configgen/generator.goto marshal a typed Go struct viagopkg.in/yaml.v3(which escapes correctly) instead oftext/templatestring-concat. Larger change, but eliminates this entire injection class.
Option 2 is preferable long-term. Option 1 is the quick fix.
The unsafe_routes advanced field is already netip.Parse{Prefix,Addr}-validated at enroll.go:226-233 — apply the same validation discipline to the other advanced fields.
Credited to ak2k.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesCVE-2026-49258
Nebula Mesh: Web UI lacks ownership checks, enabling cross-operator access to hosts and networks (read, block, delete)
high8.8No fixJun 26, 2026GHSA-v2jf-442r-6mjh
nebula-mesh: Signed-poll nonce LRU is in-memory and bounded; replay survives restart + eviction
low2.7Jun 26, 2026GHSA-ghmh-jhmj-wcmf
nebula-mesh's stores enrollment tokens unhashed in SQLite
medium5.0Jun 22, 2026GHSA-6vgg-xhvh-38ff
nebula-mesh: POST /api/v1/hosts/{id}/mobile-bundle response lacks Cache-Control: no-store
low2.3Jun 12, 2026CVE-2026-47768
nebula-mesh: Newly-minted operator API key exposed in redirect URL (Referer, history, proxy logs)
medium5.5Jun 10, 2026CVE-2026-48025
nebula-mesh: Decrypted CA private key persists in heap after signing
mediumJun 10, 2026
