{"id":"GHSA-v2jf-442r-6mjh","aliases":["GO-2026-5815"],"status":"published","title":"nebula-mesh: Signed-poll nonce LRU is in-memory and bounded; replay survives restart + eviction","description":"`internal/api/pop/nonce.go:25,40,86` + `internal/api/server.go:38` — the signed-poll nonce cache is an in-process LRU sized at 65,536 entries. `internal/api/updates.go:31` sets `pollClockSkew = 5 * time.Minute` as the replay window.\n\n## Affected\nAll released versions through v0.3.0 that have shipped the ADR 0004 signed-poll path. (If this is gated behind a feature flag, on a side branch, or not yet on a release tag, please flag — this advisory may not apply to the released artifact yet.)\n\n## Threat model\nA captured signed-poll request can be replayed:\n\n1. **After any process restart** — the in-memory LRU is wiped, so the original nonce becomes \"unseen\" again. Replay succeeds if the original timestamp is still within the 5-minute skew.\n2. **After forced eviction** — an attacker with control of any single host can flood \u003e65,536 nonces under their own host_id, driving the global LRU to evict the victim's recorded nonce. Replay then succeeds.\n\nImpact is bounded: a replayed poll fetches the `/api/v1/agent/updates` body. That body can include a freshly-minted enrollment token if a rekey is pending (`updates.go:249-260`) — at which point the attacker holds a single-use token they can redeem under their own keypair.\n\n## Suggested fix\nTwo options, either acceptable:\n\n1. Persist nonces in SQLite keyed by `(host_id, nonce)` with `ON CONFLICT DO NOTHING`, retained for the timestamp-skew window. Adds one transactional INSERT per poll; bounded by the skew window (~5 min worth of rows server-wide).\n2. Per-host cap on the LRU instead of a global 65k cap, so one host cannot evict another's records. Combined with shorter skew (≤30s) to bound the post-restart replay window.\n\nOption 1 is more robust; option 2 is lower-implementation-effort.","severity":{"version":"4.0","score":2.7,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:U","level":"low","from":"ghsa"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-294"],"published":"2026-06-26T21:01:09Z","modified":"2026-07-07T16:11:36Z","fixes":[{"ecosystem":"Go","package":"github.com/juev/nebula-mesh","fixed_in":["0.3.4"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"Go","package":"github.com/juev/nebula-mesh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"0.3.3"},{"fixed":"0.3.4"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/juev/nebula-mesh","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.3.4"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/juev/nebula-mesh","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.3.4"}]}]}],"references":[{"url":"https://github.com/juev/nebula-mesh/security/advisories/GHSA-v2jf-442r-6mjh","tags":["web","advisory"]},{"url":"https://github.com/advisories/GHSA-v2jf-442r-6mjh"},{"url":"https://github.com/juev/nebula-mesh","tags":["package"]}],"sources":{"ghsa":[{"id":"GHSA-v2jf-442r-6mjh","title":"nebula-mesh: Signed-poll nonce LRU is in-memory and bounded; replay survives restart + eviction","description":"`internal/api/pop/nonce.go:25,40,86` + `internal/api/server.go:38` — the signed-poll nonce cache is an in-process LRU sized at 65,536 entries. `internal/api/updates.go:31` sets `pollClockSkew = 5 * time.Minute` as the replay window.\n\n## Affected\nAll released versions through v0.3.0 that have shipped the ADR 0004 signed-poll path. (If this is gated behind a feature flag, on a side branch, or not yet on a release tag, please flag — this advisory may not apply to the released artifact yet.)\n\n## Threat model\nA captured signed-poll request can be replayed:\n\n1. **After any process restart** — the in-memory LRU is wiped, so the original nonce becomes \"unseen\" again. Replay succeeds if the original timestamp is still within the 5-minute skew.\n2. **After forced eviction** — an attacker with control of any single host can flood \u003e65,536 nonces under their own host_id, driving the global LRU to evict the victim's recorded nonce. Replay then succeeds.\n\nImpact is bounded: a replayed poll fetches the `/api/v1/agent/updates` body. That body can include a freshly-minted enrollment token if a rekey is pending (`updates.go:249-260`) — at which point the attacker holds a single-use token they can redeem under their own keypair.\n\n## Suggested fix\nTwo options, either acceptable:\n\n1. Persist nonces in SQLite keyed by `(host_id, nonce)` with `ON CONFLICT DO NOTHING`, retained for the timestamp-skew window. Adds one transactional INSERT per poll; bounded by the skew window (~5 min worth of rows server-wide).\n2. Per-host cap on the LRU instead of a global 65k cap, so one host cannot evict another's records. Combined with shorter skew (≤30s) to bound the post-restart replay window.\n\nOption 1 is more robust; option 2 is lower-implementation-effort.","status":"published","published":"2026-06-26T21:01:09Z","modified":"2026-06-26T21:01:10Z","cvss":[{"version":"4.0","score":2.7,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:U","level":"low"}],"cwes":["CWE-294"],"updated_at":"2026-11-02T14:40:34.713036Z"}],"osv":[{"id":"GHSA-v2jf-442r-6mjh","title":"nebula-mesh: Signed-poll nonce LRU is in-memory and bounded; replay survives restart + eviction","description":"`internal/api/pop/nonce.go:25,40,86` + `internal/api/server.go:38` — the signed-poll nonce cache is an in-process LRU sized at 65,536 entries. `internal/api/updates.go:31` sets `pollClockSkew = 5 * time.Minute` as the replay window.\n\n## Affected\nAll released versions through v0.3.0 that have shipped the ADR 0004 signed-poll path. (If this is gated behind a feature flag, on a side branch, or not yet on a release tag, please flag — this advisory may not apply to the released artifact yet.)\n\n## Threat model\nA captured signed-poll request can be replayed:\n\n1. **After any process restart** — the in-memory LRU is wiped, so the original nonce becomes \"unseen\" again. Replay succeeds if the original timestamp is still within the 5-minute skew.\n2. **After forced eviction** — an attacker with control of any single host can flood \u003e65,536 nonces under their own host_id, driving the global LRU to evict the victim's recorded nonce. Replay then succeeds.\n\nImpact is bounded: a replayed poll fetches the `/api/v1/agent/updates` body. That body can include a freshly-minted enrollment token if a rekey is pending (`updates.go:249-260`) — at which point the attacker holds a single-use token they can redeem under their own keypair.\n\n## Suggested fix\nTwo options, either acceptable:\n\n1. Persist nonces in SQLite keyed by `(host_id, nonce)` with `ON CONFLICT DO NOTHING`, retained for the timestamp-skew window. Adds one transactional INSERT per poll; bounded by the skew window (~5 min worth of rows server-wide).\n2. Per-host cap on the LRU instead of a global 65k cap, so one host cannot evict another's records. Combined with shorter skew (≤30s) to bound the post-restart replay window.\n\nOption 1 is more robust; option 2 is lower-implementation-effort.","status":"published","published":"2026-06-26T21:01:09Z","modified":"2026-07-07T16:11:36.907200554Z","cvss":[{"version":"4.0","score":2.7,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:U","level":"low"}],"cwes":["CWE-294"],"updated_at":"2026-11-02T15:46:56.639206Z"},{"id":"GO-2026-5815","title":"nebula-mesh: Signed-poll nonce LRU is in-memory and bounded; replay survives restart + eviction in github.com/juev/nebula-mesh","description":"nebula-mesh: Signed-poll nonce LRU is in-memory and bounded; replay survives restart + eviction in github.com/juev/nebula-mesh","status":"published","published":"2026-07-07T15:26:32Z","modified":"2026-07-07T16:00:20.657505521Z","updated_at":"2026-11-02T15:47:02.838915Z"}]}}
