{"id":"CVE-2026-5774","revision":null,"records":[{"revision":"c13fbbd90eee43ca95d931bb96a8aeba","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-5774","aliases":[],"title":"Juju API Server Denial of Service and Authentication Replay via Unsynchronized Token Map","description":"Improper synchronization of the userTokens map in the API server in Canonical Juju\u00A04.0.5,\u00A03.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.","state":0,"publishedAt":"2026-04-10T12:10:55.634+00:00","modifiedAt":"2026-04-10T12:41:28.72+00:00","affected":[{"ecosystem":"https://github.com/juju/","name":"juju","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"collectionURL\": \"https://github.com/juju/\",\n                    \"defaultStatus\": \"unaffected\",\n                    \"packageName\": \"juju\",\n                    \"platforms\": [\n                        \"Linux\"\n                    ],\n                    \"product\": \"Juju\",\n                    \"repo\": \"https://github.com/juju/juju\",\n                    \"vendor\": \"Canonical\",\n                    \"versions\": [\n                        {\n                            \"status\": \"affected\",\n                            \"version\": \"2.0.0\",\n                            \"lessThan\": \"2.9.57\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"status\": \"affected\",\n                            \"version\": \"3.0.0\",\n                            \"lessThan\": \"3.6.21\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"status\": \"affected\",\n                            \"version\": \"4.0.0\",\n                            \"lessThan\": \"4.0.6\",\n                            \"versionType\": \"semver\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":6.1,"severity":"MEDIUM"}],"references":["https://github.com/juju/juju/security/advisories/GHSA-7m55-2hr4-pw78","https://github.com/juju/juju/pull/22206","https://github.com/juju/juju/pull/22205"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-5774","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-5774","identifiers":["CVE-2026-5774"]},"retained":false,"historicalAffected":[]},{"revision":"719035d3e78a4526876f74162696419a","observedAt":"2026-10-28T08:17:32.306+00:00","statement":{"source":"euvd","id":"EUVD-2026-21366","aliases":["CVE-2026-5774"],"title":"Improper synchronization of the userTokens map in the API server in Canonical Juju\u00A04.0.5,\u00A03.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.","description":"Improper synchronization of the userTokens map in the API server in Canonical Juju\u00A04.0.5,\u00A03.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.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":6.1,"severity":null}],"references":["https://github.com/juju/juju/security/advisories/GHSA-7m55-2hr4-pw78","https://github.com/juju/juju/pull/22206","https://github.com/juju/juju/pull/22205"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-21366","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Apr 10, 2026, 12:10:55 PM","dateUpdated":"Apr 10, 2026, 12:41:28 PM"},"relatedAdvisories":[],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2026-21366","identifiers":["EUVD-2026-21366","CVE-2026-5774"]},"retained":false,"historicalAffected":[]},{"revision":"2463ebaf8aae478b9a76f4232806ef4b","observedAt":"2026-10-27T15:15:28.354+00:00","statement":{"source":"nvd","id":"CVE-2026-5774","aliases":[],"title":"Improper synchronization of the userTokens map in the API server in Canonical Juju\u00A04.0.5,\u00A03.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.","description":"Improper synchronization of the userTokens map in the API server in Canonical Juju\u00A04.0.5,\u00A03.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.","state":0,"publishedAt":"2026-04-10T13:16:46.07+00:00","modifiedAt":"2026-10-26T21:10:00.17+00:00","affected":[],"metrics":[{"system":"CVSS 4.0 · security@ubuntu.com · Secondary","vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","score":6,"severity":"MEDIUM"},{"system":"CVSS 3.1 · nvd@nist.gov · Primary","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H","score":6.4,"severity":"MEDIUM"}],"references":["https://github.com/juju/juju/pull/22205","https://github.com/juju/juju/pull/22206","https://github.com/juju/juju/security/advisories/GHSA-7m55-2hr4-pw78"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-5774","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Analyzed","weaknesses":["CWE-362"],"productCriteria":["cpe:2.3:a:canonical:juju:*:*:*:*:*:*:*:*"],"sourceDates":{"published":"2026-04-10T13:16:46.070","lastModified":"2026-10-26T21:10:00.170"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-5774","identifiers":["CVE-2026-5774"]},"retained":false,"historicalAffected":[]},{"revision":"5b5f3205d7064315845b21501a2dcbc5","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GHSA-7m55-2hr4-pw78","aliases":["CVE-2026-5774","GO-2026-5228"],"title":"Juju: In-Memory Token Store for Discharge Tokens Lacks Concurrency Safety and Persistence","description":"### Summary\n\nThe 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.\n\n### Details\n\nWhen 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.\n\nGo'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.\n\nThe struct definition that introduces the unsafe field is shown below.\n\n```go\ntype localLoginHandlers struct {\n    authCtxt   *authContext\n    userTokens map[string]string\n}\n```\n\nThe 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.\n\n### PoC\n\n```go\npackage main\n\nimport (\n    \"net/http\"\n    \"sync\"\n)\n\nfunc main() {\n    token := \"acquired-discharge-token\"\n    endpoint := \"https://target-juju-api:17070/local-login/discharge\"\n\n    var wg sync.WaitGroup\n    for i := 0; i < 20; i++ {\n        wg.Add(1)\n        go func() {\n            defer wg.Done()\n            req, _ := http.NewRequest(\"GET\", endpoint+\"?token=\"+token, nil)\n            http.DefaultClient.Do(req)\n        }()\n    }\n    wg.Wait()\n}\n```\n\n### Impact\n\nAny 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.","state":0,"publishedAt":"2026-04-10T21:00:35+00:00","modifiedAt":"2026-06-25T19:56:07.0861283+00:00","affected":[{"ecosystem":"Go","name":"github.com/juju/juju","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"0.0.0-20260408003526-d395054dc2c3"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H","score":null,"severity":null},{"system":"CVSS_V4","vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:N/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/juju/juju/security/advisories/GHSA-7m55-2hr4-pw78","https://nvd.nist.gov/vuln/detail/CVE-2026-5774","https://github.com/juju/juju/pull/22205","https://github.com/juju/juju/pull/22206","https://github.com/juju/juju"],"sourceUrl":"https://github.com/advisories/GHSA-7m55-2hr4-pw78","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-7m55-2hr4-pw78","identifiers":["GHSA-7m55-2hr4-pw78","CVE-2026-5774","GO-2026-5228"]},"retained":false,"historicalAffected":[]},{"revision":"138705a8a94b4f4db18be8ae00b2fd4d","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GO-2026-5228","aliases":["CVE-2026-5774","GHSA-7m55-2hr4-pw78"],"title":"Juju: In-Memory Token Store for Discharge Tokens Lacks Concurrency Safety and Persistence in github.com/juju/juju","description":"Juju: In-Memory Token Store for Discharge Tokens Lacks Concurrency Safety and Persistence in github.com/juju/juju","state":0,"publishedAt":"2026-06-25T18:43:15+00:00","modifiedAt":"2026-06-25T19:45:17.6047401+00:00","affected":[{"ecosystem":"Go","name":"github.com/juju/juju","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"0.0.0-20260408003526-d395054dc2c3"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[],"references":["https://github.com/juju/juju/security/advisories/GHSA-7m55-2hr4-pw78","https://nvd.nist.gov/vuln/detail/CVE-2026-5774","https://github.com/juju/juju/pull/22205","https://github.com/juju/juju/pull/22206"],"sourceUrl":"https://osv.dev/vulnerability/GO-2026-5228","license":"OSV · upstream source license applies","key":"osv:GO-2026-5228","identifiers":["GO-2026-5228","CVE-2026-5774","GHSA-7m55-2hr4-pw78"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-10-30T01:48:55.4491357+00:00","complete":true,"records":1764,"lastAttemptAt":"2026-10-30T01:48:55.4491357+00:00","lastSuccessAt":"2026-10-30T01:48:55.6546169+00:00","error":null,"lastVerifiedAt":"2026-10-30T01:48:55.6546176+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-7e2c4e7288f2c464ad8c61f3bb6017374714faedcc781283ac06a706ee1a820b-8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85","complete":true,"records":416807,"lastAttemptAt":"2026-10-30T01:48:54.7743429+00:00","lastSuccessAt":"2026-10-30T00:54:38.6858592+00:00","error":null,"lastVerifiedAt":"2026-10-30T01:48:54.7743429+00:00","snapshotPublishedAt":"2026-10-30T01:29:33+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-824f5092797940c08129032fcab8f0dd","complete":false,"records":13504,"lastAttemptAt":"2026-10-30T02:01:05.0861472+00:00","lastSuccessAt":"2026-10-30T02:01:05.08+00:00","error":"9 identifier lookups failed; latest failures include HTTP 403. Other identifiers were checked independently.","lastVerifiedAt":"2026-10-30T02:01:05.08+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13547,"expectedIdentifiers":13587,"failedIdentifiers":9},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-10-30T01:48:55.4491357+00:00","complete":true,"records":1094,"lastAttemptAt":"2026-10-30T01:48:55.4491357+00:00","lastSuccessAt":"2026-10-30T01:48:55.6554576+00:00","error":null,"lastVerifiedAt":"2026-10-30T01:48:55.6554578+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-c39f89b50d5243318487ad216daf7ffb","complete":true,"records":13527,"lastAttemptAt":"2026-10-30T01:48:56.2261206+00:00","lastSuccessAt":"2026-10-29T22:50:37.74+00:00","error":null,"lastVerifiedAt":"2026-10-29T22:50:37.74+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13587,"expectedIdentifiers":13587,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-9016081e9e88f5929902343d85df87c5c4a1486b10ab07bc6c4f53f98f358871","complete":true,"records":9806,"lastAttemptAt":"2026-10-30T01:48:55.2317852+00:00","lastSuccessAt":"2026-10-29T17:17:25.9359141+00:00","error":null,"lastVerifiedAt":"2026-10-30T01:48:55.2317852+00:00","snapshotPublishedAt":"2026-10-29T16:48:29+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-2de9ccc5290f060c7aa63f89c25dd76f655a64ba1aba7c05c97fa3bee4f09899","complete":true,"records":1967,"lastAttemptAt":"2026-10-30T01:48:54.9356382+00:00","lastSuccessAt":"2026-10-28T20:55:34.2982937+00:00","error":null,"lastVerifiedAt":"2026-10-30T01:48:54.9356382+00:00","snapshotPublishedAt":"2026-10-28T20:03:08+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-5221f6b645588be0464ab0e16e8adfe42d1ccd8f841048d2bd4d0c1cf79fd6b1","complete":true,"records":3014,"lastAttemptAt":"2026-10-30T01:48:55.4168216+00:00","lastSuccessAt":"2026-10-30T00:54:54.6624163+00:00","error":null,"lastVerifiedAt":"2026-10-30T01:48:55.4168216+00:00","snapshotPublishedAt":"2026-10-30T00:48:06+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-ec5b13e78c39945726a720832da7660d2774969f16e2a34f99460c135811abd5","complete":true,"records":230948,"lastAttemptAt":"2026-10-30T01:48:55.0481567+00:00","lastSuccessAt":"2026-10-29T22:50:35.0693267+00:00","error":null,"lastVerifiedAt":"2026-10-30T01:48:55.0481567+00:00","snapshotPublishedAt":"2026-10-29T22:33:13+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}