CVE-2020-36564: nosurf vulnerable to improper input validation
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.2279%
CWE
Published
12/28/2022
Updated
2/3/2023
KEV Status
No
Technology
Go
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| github.com/justinas/nosurf | go | < 1.1.1 | 1.1.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from two key issues: 1) VerifyToken used error-prone base64 decoding that didn't validate input validity, allowing malformed tokens to decode to empty values. 2) The legacy b64decode helper function ignored decoding errors. When combined, these allowed attackers to submit arbitrary tokens that would be considered valid if the expected token was malformed. The patch replaced b64decode with proper error-checked base64 decoding and added length validation in tokensEqual(), confirming these functions as the root cause.