CVE-2022-21221
JSON

5.9medium

Directory Traversal

Severity
5.9medium CVSS:3.1 by snyk
Exploit likelihood
2.50% (higher than 85% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
snyk
Also known as
GHSA-fx95-883v-4q4hGO-2022-0355SNYK-GOLANG-GITHUBCOMVALYALAFASTHTTP-2407866

Description

The package github.com/valyala/fasthttp before 1.34.0 are vulnerable to Directory Traversal via the ServeFile function, due to improper sanitization. It is possible to be exploited by using a backslash %5c character in the path. **Note:** This security issue impacts Windows users only.

Affected

Product or packageVersionsReported by
github.com/valyala/fasthttpfrom unspecified before 1.34.0CVE List
github.com/valyala/fasthttp (Go)before 1.34.0GitHub Advisory Database, Go Vulnerability Database
fasthttp_project fasthttpbefore 1.34.0NVD

All scores

snyk5.9medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
NVD5.0medium CVSS:2.0AV:N/AC:L/Au:N/C:P/I:N/A:N

Classification

What each source says

CVE List

The package github.com/valyala/fasthttp before 1.34.0 are vulnerable to Directory Traversal via the ServeFile function, due to improper sanitization. It is possible to be exploited by using a backslash %5c character in the path. **Note:** This security issue impacts Windows users only.

GitHub Advisory Database

The package github.com/valyala/fasthttp before 1.34.0 is vulnerable to Directory Traversal via the ServeFile function, due to improper sanitization. It is possible to be exploited by using a backslash %5c character in the path. Note: This security issue impacts Windows users only.

Go Vulnerability Database

The fasthttp.FS request handler is vulnerable to directory traversal attacks on Windows systems, and can serve files from outside the provided root directory.

URL path normalization does not handle Windows path separators (backslashes), permitting an attacker to construct requests with relative paths.

NVD (es)

El paquete github.com/valyala/fasthttp versiones anteriores a 1.34.0, es vulnerable a un Salto de Directorio por medio de la función ServeFile, debido a un saneo inapropiado. Puede explotarse usando un carácter de barra invertida %5c en la ruta. **Nota:** Este problema de seguridad afecta únicamente a usuarios de Windows

References

Sources

SourceRecordLicence
CVE ListCVE-2022-21221 changed 2024-09-16CVE Terms of Use
GitHub Advisory DatabaseGHSA-fx95-883v-4q4h changed 2026-07-08CC-BY-4.0
Go Vulnerability DatabaseGO-2022-0355 changed 2026-07-08CC-BY-4.0
NVDCVE-2022-21221 changed 2026-06-17Public domain