CVE-2022-30636 Limited directory traversal vulnerability on Windows in golang.org/x/crypto
An attacker can read arbitrary files on Windows systems if they end with the specific suffix +http-01 due to path traversal in the ACME autocert cache.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2022-30636?
CVE-2022-30636 is a high-severity path traversal vulnerability in golang.org/x/crypto/acme/autocert, published on 2 Jul 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
httpTokenCacheKey uses path.Base to extract the expected HTTP-01 token value to lookup in the DirCache implementation. On Windows, path.Base acts differently to filepath.Base, since Windows uses a different path separator (\ vs. /), allowing a user to provide a relative path, i.e. .well-known/acme-challenge/..\..\asd becomes ..\..\asd. The extracted path is then suffixed with +http-01, joined with the cache directory, and opened. Since the controlled path is suffixed with +http-01 before opening, the impact of this is significantly limited, since it only allows reading arbitrary files on the system if and only if they have this suffix.
Which versions are affected by CVE-2022-30636?
1 open source package ship an affected version, including golang.org/x/crypto.
| Package | Affected | Fixed in |
|---|---|---|
golang.org/x/crypto Go | All versions | 0.0.0-20220525230936-793ad666bf5e |
How do I fix CVE-2022-30636?
Upgrade golang.org/x/crypto to 0.0.0-20220525230936-793ad666bf5e or later.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2022-30636 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-30636 exists.
Sources
Also known as CLEANSTART-2026-GE07592, CLEANSTART-2026-QN19137, DEBIAN-CVE-2022-30636, GO-2024-2961, MINI-hm94-v333-g5qh.