curl / Docs / Security Problems / .netrc parser out-of-bounds access

CVE-2022-35260: .netrc parser out-of-bounds access

Project curl Security Advisory, October 26 2022 - Permalink


curl can be told to parse a .netrc file for credentials. If that file ends in a line with consecutive non-white space letters and no newline, curl could read past the end of the stack-based buffer, and if the read works, write a zero byte possibly beyond its boundary.

This will in most cases cause a segfault or similar, but circumstances might also cause different outcomes.

If a malicious user can provide a custom netrc file to an application or otherwise affect its contents, this flaw could be used as denial-of-service.

We are not aware of any exploit of this flaw.


The flaw was introduced in curl with this commit, first shipped in curl 7.84.0.

The Common Vulnerabilities and Exposures (CVE) project has assigned the name CVE-2022-35260 to this issue.

CWE-121: Stack-based Buffer Overflow

Severity: low


libcurl is used by many applications, but not always advertised as such!


The fix for CVE-2022-35260


A - Upgrade curl to version 7.86.0

B - Apply the patch to your local version

C - Do not use .netrc files


This issue was reported to the curl project on October 3, 2022. We contacted distros@openwall on October 18, 2022.

libcurl 7.86.0 was released on October 26 2022, coordinated with the publication of this advisory.


Thanks a lot!