CVE-2022-29804: Vulnerability in stdlib package (Directory Traversal Attack)

stdlib Updated 02 Oct 2025

Summary

10/08/2022
Yes i
High
7.5

CVE-2022-29804: ELSA-2022-17957: ol8addon security update (IMPORTANT). Affects stdlib versions < 1.17.11, 1.18.3. Fixed in 1.17.11, 1.18.3. How to fix ↓

Also tracked for

The same CVE-2022-29804 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The stdlib package is a standard library in the Go programming language. It provides a set of essential functions and utilities for various tasks. This vulnerability affects versions 1.18.2 and earlier of the stdlib package. The vulnerability allows potential directory traversal attacks on Windows systems due to incorrect conversion of certain invalid paths to valid, absolute paths in the Clean function of the path/filepath package. This can lead to unauthorized access to sensitive files and directories.

Vulnerability Detail

The vulnerability arises from a flaw in the Clean function of the path/filepath package in the stdlib package. When processing certain invalid paths, the Clean function incorrectly converts them to valid, absolute paths. This can be exploited by an attacker to traverse directories and access files outside the intended scope. The impact of this vulnerability is significant as it can lead to unauthorized disclosure of sensitive information or unauthorized modification of critical files. The vulnerability has a CVSS score of 7.5, indicating a high severity level.

How To Fix

Minimum fixed version

1.17.11, 1.18.3

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no specific workaround mentioned for this vulnerability. However, developers can implement additional input validation and sanitization measures to mitigate the risk of directory traversal attacks in their applications. This can include validating user input for file paths and restricting access to sensitive directories.

Conclusion

The vulnerability in the stdlib package (CVE-2022-29804) poses a significant risk of directory traversal attacks on Windows systems. It is crucial to update the package to version 1.17.11 or 1.18.3 to mitigate this vulnerability. Additionally, implementing input validation and sanitization measures can further enhance the security of applications. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for stdlib →

Share this vulnerability

FAQ

The vulnerability allows potential directory traversal attacks, which can lead to unauthorized access to sensitive files and directories. This can result in the unauthorized disclosure of sensitive information or unauthorized modification of critical files.

Versions 1.18.2 and earlier of the stdlib package are affected by this vulnerability.

There are no known exploits for this vulnerability at the time of this report. However, it is essential to apply the recommended fixes to mitigate the risk of exploitation.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities without requiring access to the code or installation.

You can find more information about this vulnerability in the National Vulnerability Database (NVD) entry at https://nvd.nist.gov/vuln/detail/CVE-2022-29804.

Related vulnerabilities

Recent vulnerabilities recorded for stdlib.

How To Fix

Minimum fixed version

1.17.11, 1.18.3

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback