{"id":"CVE-2026-47722","aliases":["CVE-2026-47722","GHSA-7hp6-g3pq-3pc3","GO-2026-5223"],"related":[],"kind":"vulnerability","state":"published","title":"nebula-mesh: Host advanced overrides allow YAML injection into agent config.yml","summary":"nebula-mesh is a self-hosted control plane for Slack Nebula mesh virtual private network. Prior to version 0.3.2, `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. Version 0.3.2 fixes the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"nebula-mesh is a self-hosted control plane for Slack Nebula mesh virtual private network. Prior to version 0.3.2, `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. Version 0.3.2 fixes the issue.","source":"cvelist"},{"lang":"en","text":"`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.\n\n## Exploit\nAn operator (or attacker with any operator key, given the cross-tenant CRUD advisory) sets `adv_tun_device` to:\n\n```\nnebula0\nlighthouse:\n  am_lighthouse: true\n  hosts: [\"10.0.0.1\"]\n#\n```\n\nThe 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.\n\n## Affected\nAll released versions prior to v0.3.2.\n\n## Threat model\n- **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).\n- **Combined with the critical /api/v1 authz advisory**: any operator key can mutate ANOTHER tenant's host overrides and inject YAML there.\n- **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.\n\n## Suggested fix\nTwo options, either acceptable:\n\n1. **Input validation** in `parseAdvancedFromForm` (`internal/web/advanced.go`):\n   - `ListenHost`: regex `^[A-Za-z0-9.:\\[\\]_-]+$` (IPv4/IPv6/hostname)\n   - `TunDevice`: regex `^[A-Za-z0-9_-]{1,15}$` (Linux IFNAMSIZ caps at 15)\n   Reject invalid input with a form-level error; do not write to the host row.\n\n2. **Safer marshalling**: switch `configgen/generator.go` to marshal a typed Go struct via `gopkg.in/yaml.v3` (which escapes correctly) instead of `text/template` string-concat. Larger change, but eliminates this entire injection class.\n\nOption 2 is preferable long-term. Option 1 is the quick fix.\n\nThe `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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"nebula-mesh: Host advanced overrides allow YAML injection into agent config.yml in github.com/juev/nebula-mesh","format":"markdown","source":"go"},{"lang":"es","text":"nebula-mesh es un plano de control autoalojado para la red privada virtual de malla Nebula de Slack. Antes de la versión 0.3.2, ’internal/configgen/generator.go:86,108,119’ interpola los campos ’ListenHost’ y ’TunDevice’ suministrados por el operador directamente en una plantilla de texto (’text/template’) que produce el ’config.yml’ del agente. ’internal/web/advanced.go:20-35’ acepta ambos solo con ’strings.TrimSpace’ - sin validación de caracteres o formato. La versión 0.3.2 corrige el problema.","source":"nvd"}],"published":"2026-06-08T23:08:15.000Z","modified":"2026-10-24T13:10:00.147Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","rating":"HIGH"}],"cwes":["CWE-94"],"affected":[{"ranges":[{"version":"< 0.3.2","status":"affected"}],"vendor":"juev","product":"nebula-mesh","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.3.2"}],"ecosystem":"Go","package":"github.com/juev/nebula-mesh","purl":"pkg:golang/github.com/juev/nebula-mesh","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.3.2"}],"ecosystem":"Go","package":"github.com/juev/nebula-mesh","purl":"pkg:golang/github.com/juev/nebula-mesh","source":"go"}],"references":[{"url":"https://github.com/forgekeep/nebula-mesh/security/advisories/GHSA-7hp6-g3pq-3pc3","tags":["x-refsource-confirm"],"sources":["cvelist","nvd"]},{"url":"https://github.com/forgekeep/nebula-mesh/issues/126","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/forgekeep/nebula-mesh/commit/c1506f7344ab375a145a7449b193af3f19bb41ef","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/juev/nebula-mesh/security/advisories/GHSA-7hp6-g3pq-3pc3","tags":["advisory","web"],"sources":["ghsa","go"]},{"url":"https://github.com/juev/nebula-mesh","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-07-24T11:11:06.602Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-47722","url":"https://www.cve.org/CVERecord?id=CVE-2026-47722","licence":"CVE Terms of Use","modified":"2026-07-24T11:11:20.665Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-7hp6-g3pq-3pc3","url":"https://github.com/advisories/GHSA-7hp6-g3pq-3pc3","licence":"CC-BY-4.0","modified":"2026-06-25T19:56:05.153Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5223","url":"https://pkg.go.dev/vuln/GO-2026-5223","licence":"CC-BY-4.0","modified":"2026-06-25T19:45:15.329Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-47722","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47722","licence":"Public domain","modified":"2026-10-24T13:10:00.147Z"}],"updatedAt":"2026-11-25T22:59:29.950Z","epss":{"score":0.00269,"percentile":0.20355,"date":"2026-12-02T12:00:21.000Z"}}