CVE-2026-5774: Juju API Server Denial of Service and Authentication Replay via Unsynchronized Token Map

Published Apr 10, 2026
·
Updated

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 executes h.userTokens[token] = username in a separate goroutine.

PoC

go package main

import ( "net/http" "sync" )

func main() { token := "acquired-discharge-token" endpoint := "https://target-juju-api:17070/local-login/discharge"

var wg sync.WaitGroup for i := 0; i < 20; i++ { wg.Add(1) go func() { defer wg.Done() req, := http.NewRequest("GET", endpoint+"?token="+token, nil) http.DefaultClient.Do(req) }() } wg.Wait() }

Impact

Any authenticated user who obtains a valid discharge token can send a burst of concurrent requests to the discharge endpoint. The most reliable outcome is a Go runtime panic caused by concurrent map access, which terminates the Juju API server process and denies service to all connected clients and agents. Under favorable timing conditions the same token may be accepted by multiple goroutines before deletion, bypassing the single-use enforcement and allowing repeated authentication with a token that should have been invalidated after first use.

Other sources

Improper synchronization of the userTokens map in the API server in Canonical Juju 4.0.5, 3.6.20, and 2.9.56 may allow an authenticated user to possibly cause a denial of service on the server or possibly reuse a single-use discharge token.

MITRE

Affected Software

4 affected componentsFixes available
go/github.com/juju/juju<0.0.0-20260408003526-d395054dc2c3
0.0.0-20260408003526-d395054dc2c3
Canonical Juju<2.9.57
Canonical Juju>=3.0<3.6.21
Canonical Juju>=4.0<4.0.6

Event History

Apr 10, 2026
CVE Published
via MITRE·12:10 PM
Data Sourced
via MITRE·12:10 PM
DescriptionWeakness
Data Sourced
via NVD·01:16 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·01:16 PM
Affected Software
Advisory Published
via GitHub·09:00 PM
Data Sourced
via GitHub·09:00 PM
DescriptionWeaknessAffected Software
May 21, 58279
Event
via FIRST·08:21 AM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-5774?

CVE-2026-5774 has a severe impact as it can lead to denial of service and authentication replay vulnerabilities.

2

How do I fix CVE-2026-5774?

To fix CVE-2026-5774, update your Juju installation to a safe version beyond 0.0.0-20260408003526-d395054dc2c3 or to the latest release.

3

Which versions of Juju are affected by CVE-2026-5774?

CVE-2026-5774 affects Juju versions up to 0.0.0-20260408003526-d395054dc2c3, as well as certain versions in the 2.x to 4.x series.

4

What types of attacks can CVE-2026-5774 facilitate?

CVE-2026-5774 can facilitate denial of service attacks and authentication replay attacks due to unsynchronized access to the token map.

5

Is there a workaround for CVE-2026-5774?

There are no official workarounds for CVE-2026-5774; upgrading to the fixed versions is recommended.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203