{"id":"CVE-2020-26521","aliases":["CVE-2020-26521","GHSA-h2fg-54x9-5qhq","GHSA-hmm9-r2m2-qg9w","GO-2022-0402"],"related":["CGA-2v6p-mg24-q4w7"],"kind":"vulnerability","state":"published","title":"Nil dereference in NATS JWT, DoS of nats-server","summary":"The JWT library in NATS nats-server before 2.1.9 allows a denial of service (a nil dereference in Go code).","summarySource":"cvelist","descriptions":[{"lang":"en","text":"The JWT library in NATS nats-server before 2.1.9 allows a denial of service (a nil dereference in Go code).","source":"cvelist"},{"lang":"en","text":"## Problem Description\n\nThe NATS account system has an Operator trusted by the servers, which signs Accounts, and each Account can then create and sign Users within their account.  The Operator should be able to safely issue Accounts to other entities which it does not fully trust.\n\nA malicious Account could create and sign a User JWT with a state not created by the normal tooling, such that decoding by the NATS JWT library (written in Go) would attempt a nil dereference, aborting execution.\n\nThe NATS Server is known to be impacted by this.\n\n\n## Affected versions\n\n#### JWT library\n\n * all versions prior to 1.1.0\n\n#### NATS Server\n\n * Version 2 prior to 2.1.9\n\n\n## Impact\n\n#### JWT library\n\n * Programs would nil dereference and panic, aborting execution by default.\n\n#### NATS server\n\n * Denial of Service caused by process termination\n\n\n## Workaround\n\nIf your NATS servers do not trust any accounts which are managed by untrusted entities, then malformed User credentials are unlikely to be encountered.\n\n\n## Solution\n\nUpgrade the JWT dependency in any application using it.\n\nUpgrade the NATS server if using NATS Accounts.","format":"markdown","source":"ghsa"},{"lang":"en","text":"(This advisory is canonically <https://advisories.nats.io/CVE/CVE-2020-26521.txt>)\n\n## Problem Description\n\nThe NATS account system has an Operator trusted by the servers, which signs Accounts, and each Account can then create and sign Users within their account.  The Operator should be able to safely issue Accounts to other entities which it does not fully trust.\n\nA malicious Account could create and sign a User JWT with a state not created by the normal tooling, such that decoding by the NATS JWT library (written in Go) would attempt a nil dereference, aborting execution.\n\nThe NATS Server is known to be impacted by this.\n\n\n## Affected versions\n\n#### JWT library\n\n * all versions prior to 1.1.0\n\n#### NATS Server\n\n * Version 2 prior to 2.1.9\n\n\n## Impact\n\n#### JWT library\n\n * Programs would nil dereference and panic, aborting execution by default.\n\n#### NATS server\n\n * Denial of Service caused by process termination\n\n\n## Workaround\n\nIf your NATS servers do not trust any accounts which are managed by untrusted entities, then malformed User credentials are unlikely to be encountered.\n\n\n## Solution\n\nUpgrade the JWT dependency in any application using it.\n\nUpgrade the NATS server if using NATS Accounts.","format":"markdown","source":"ghsa"},{"lang":"en","text":"A malicious account can create and sign a User JWT which causes a panic when decoded by the NATS JWT library.","format":"markdown","source":"go"},{"lang":"es","text":"La biblioteca JWT en NATS nats-server versiones anteriores a 2.1.9, permite una denegación de servicio (una desreferencia nil en el código Go)","source":"nvd"}],"published":"2020-11-06T07:35:12.000Z","modified":"2026-09-10T03:49:14.679Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:N/I:N/A:P","score":5,"rating":"MEDIUM"}],"cwes":["CWE-476"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.1.0"}],"ecosystem":"Go","package":"github.com/nats-io/jwt","purl":"pkg:golang/github.com/nats-io/jwt","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.1.9"}],"ecosystem":"Go","package":"github.com/nats-io/nats-server/v2","purl":"pkg:golang/github.com/nats-io/nats-server/v2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.1.0"}],"ecosystem":"Go","package":"github.com/nats-io/jwt","purl":"pkg:golang/github.com/nats-io/jwt","source":"go"},{"ranges":[{"status":"affected","fixed":"2.1.9"}],"vendor":"linuxfoundation","product":"nats-server","cpe":"cpe:2.3:a:linuxfoundation:nats-server:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"33"}],"vendor":"fedoraproject","product":"fedora","cpe":"cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/nats-io/nats-server/commits/master","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"http://www.openwall.com/lists/oss-security/2020/11/02/2","tags":["mailing-list","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/VT67XCLIIBYRT762SVFBYFFTQFVSM3SI/","tags":["vendor-advisory","x-refsource-fedora","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://github.com/nats-io/jwt/security/advisories/GHSA-h2fg-54x9-5qhq","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2020-26521","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/nats-io/jwt/pull/107","tags":["fix","web"],"sources":["ghsa","go"]},{"url":"https://github.com/nats-io/nats-server/commit/9ff8bcde2e46009e98bd9e88f598af355f62c168","tags":["web"],"sources":["ghsa"]},{"url":"https://advisories.nats.io/CVE/CVE-2020-26521.txt","tags":["web"],"sources":["ghsa","go"]},{"url":"https://github.com/nats-io/jwt","tags":["package"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VT67XCLIIBYRT762SVFBYFFTQFVSM3SI","tags":["web"],"sources":["ghsa"]},{"url":"https://pkg.go.dev/vuln/GO-2022-0402","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nats-io/nats-server/security/advisories/GHSA-hmm9-r2m2-qg9w","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nats-io/nats-server","tags":["package"],"sources":["ghsa"]},{"url":"https://www.openwall.com/lists/oss-security/2020/11/02/2","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2020-26521","url":"https://www.cve.org/CVERecord?id=CVE-2020-26521","licence":"CVE Terms of Use","modified":"2024-08-04T15:56:04.653Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-h2fg-54x9-5qhq","url":"https://github.com/advisories/GHSA-h2fg-54x9-5qhq","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:12.147Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hmm9-r2m2-qg9w","url":"https://github.com/advisories/GHSA-hmm9-r2m2-qg9w","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:14.679Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2022-0402","url":"https://pkg.go.dev/vuln/GO-2022-0402","licence":"CC-BY-4.0","modified":"2026-02-04T03:01:19.864Z"},{"source":"nvd","name":"NVD","id":"CVE-2020-26521","url":"https://nvd.nist.gov/vuln/detail/CVE-2020-26521","licence":"Public domain","modified":"2026-06-17T03:08:08.270Z"}],"updatedAt":"2026-11-25T22:57:55.620Z","epss":{"score":0.02157,"percentile":0.82699,"date":"2026-12-01T12:00:22.000Z"}}