curl / Docs / curl CVEs / Non-preserved file permissions
Awarded 2400 USD

CVE-2022-32207

Non-preserved file permissions

Project curl Security Advisory, June 27th 2022 - Permalink

VULNERABILITY

When curl saves cookies, alt-svc and hsts data to local files, it makes the operation atomic by finalizing the operation with a rename from a temporary name to the final target file name.

In that rename operation, it might accidentally widen the permissions for the target file, leaving the updated file accessible to more users than intended.

INFO

CVE-2022-32207 was introduced in commit b834890a3fa3f52, shipped in curl 7.69.0.

This problem can be worked-around by using a strict umask.

CWE-281: Improper Preservation of Permissions

Severity: Medium

AFFECTED VERSIONS

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

SOLUTION

RECOMMENDATIONS

A - Upgrade curl to version 7.84.0

B - Apply the patch to your local version

C - Make extra precautions to protect saved files (for example strict umask)

TIMELINE

This issue was reported to the curl project on May 17, 2022. We contacted distros@openwall on June 20.

libcurl 7.84.0 was released on June 27 2022, coordinated with the publication of this advisory.

CREDITS

Thanks a lot!