MEDIUMCVSS 6.4Vulnerability

CVE-2026-5774

### Summary The localLoginHandlers struct in the Juju API server maintains an in-memory map to store discharge tokens following successful local authentication. This map is accessed concurrently from multiple HTTP handler goroutines without any synchronization primitive protecting it. The absence of a mutex or equivalent mechanism means that concurrent reads, writes, and deletes on the map can trigger Go runtime panics and may allow a discharge token to be consumed more than once before deletion completes. ### Details When a user authenticates through the local login flow, a discharge token is generated and stored in a plain `map[string]string` field named userTokens. The form handler writes to this map when authentication succeeds, and the third-party caveat checker reads from and deletes from the same map when a discharge request arrives. Both code paths execute inside goroutines dispatched by the HTTP server, meaning concurrent requests will access the map simultaneously. Go's runtime detects concurrent map access and will terminate the process with a fatal error when a write races with another write or read. This makes the API server susceptible to a denial-of-service attack from any authenticated user who can trigger simultaneous discharge requests. Beyond the crash scenario, the read-then-delete sequence in the caveat checker is not atomic. Two goroutines processing the same token concurrently may both pass the existence check before either executes the deletion, allowing a single-use discharge token to be accepted more than once and effectively replaying authentication. The struct definition that introduces the unsafe field is shown below. ```go type localLoginHandlers struct { authCtxt *authContext userTokens map[string]string } ``` The concurrent access originates from the caveat checker calling `username, ok := h.userTokens[tokenString]` followed by `delete(h.userTokens, tokenString)` with no lock held, while formHandler concurrently execu

Properties

summary
Juju: In-Memory Token Store for Discharge Tokens Lacks Concurrency Safety and Persistence
severity
MEDIUM
cvss_score
6.4
epss_score
0.00243
ghsa_published
2026-04-10T21:00:35Z
source_url
https://github.com/advisories/GHSA-7m55-2hr4-pw78
ghsa_updated
2026-04-12T10:41:30Z
ghsa_id
GHSA-7m55-2hr4-pw78
cve_id
CVE-2026-5774
cvss_vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H
is_ghsa_only
false
epss_percentile
0.15797

Related Entities (5)

ENRICHED_BY (1)

[Source]FIRST EPSS

VULNERABLE_TO (1)

[Software]go/github.com/juju/juju

AFFECTS (1)

[Software]go/github.com/juju/juju

HAS_WEAKNESS (1)

[Weakness]Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

REPORTED_BY (1)

[Source]GitHub Advisory Database

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-5774 (CVSS 6.4) — Ninja Signal Threat Intelligence | Ninja Signal