GHSA-ghmh-jhmj-wcmf: nebula-mesh's stores enrollment tokens unhashed in SQLite
internal/store/sqlite.go:1177,1192,1221,1245 — the enrollmenttokens.token column holds the raw UUID token. ConsumeToken does WHERE token = ? against the raw string. Compare with operatorapikeys.keyhash, which is SHA-256 hex (constructed in internal/api/middleware.go:51-53). Affected All released versions up to v0.3.0.
Published Jun 22, 2026
Affected packages
github.com/juev/nebula-mesh
- Ecosystem
- Go
- Affected
- <= 0.3.1
- 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/store/sqlite.go:1177,1192,1221,1245 — the enrollment_tokens.token column holds the raw UUID token. ConsumeToken does WHERE token = ? against the raw string. Compare with operator_api_keys.key_hash, which is SHA-256 hex (constructed in internal/api/middleware.go:51-53).
Affected
All released versions up to v0.3.0.
Threat model
Read access to nebula-mgmt.db: backup, snapshot, file-system access, future SQL-injection sink. The principle of defense-in-depth: API keys are hashed at rest; enrollment tokens — which grant the same lifecycle authority over a host's identity — are not.
An attacker who reads the DB before a legitimate agent enrolls can consume the single-use token first, mint a cert against their own keypair, and take the agent's intended Nebula identity.
Suggested fix
- Schema migration: rename
enrollment_tokens.token→token_hash(or add the new column and drop the old after backfill of pending rows). - Store SHA-256 of token on create: ``
go sum := sha256.Sum256([]byte(token)) row.TokenHash = hex.EncodeToString(sum[:])`` ConsumeTokenaccepts the raw token, hashes once, looks up by hash, atomically marks consumed.
Side bonus: take this opportunity to switch the token format from uuid.New().String() (122 bits) to hex.EncodeToString(crypto/rand 32 bytes) (256 bits), matching the project's session-token and API-key conventions. UUIDs are recognisable in logs and crash dumps; opaque hex blends in.
TOTP recovery codes appear to already be SHA-256 hashed at rest (internal/web/totp.go:74-78) — confirming that pattern is intentional elsewhere, just missed here.
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-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, 2026CVE-2026-48058
nebula-mesh: Session and OIDC state cookies lack the Secure attribute
medium4.6Jun 10, 2026
