Junglewise Threat Intelligence

CVE-2023-46219: curl HSTS data loss via excessively long filenames

CVE-2023-46219 · Severity: medium · CVSS 5.3 · Published 2023-12-12

Technologies: Fedoraproject Fedora, Haxx Curl. Vendors: Fedoraproject, Debian, Haxx.

Executive brief

A vulnerability in the curl data transfer tool can cause it to accidentally delete its security configuration file when using an excessively long filename. This file stores HSTS data, which ensures that connections to specific websites always use secure encryption. If this data is lost, subsequent connections may revert to insecure communication, potentially exposing sensitive information to interception.

Technical details

A logic error exists in curl's HSTS (HTTP Strict Transport Security) data saving function. The function attempts to create a temporary file by appending a suffix to the user-provided filename before renaming it to the final destination. If the original filename is near the filesystem's maximum length limit, adding the suffix causes the filename to exceed the limit, resulting in a failure that can clear the existing HSTS file contents. This leads to a loss of HSTS state, potentially allowing subsequent network requests to downgrade from HTTPS to HTTP. The issue is fixed in curl 8.5.0 by using a random sequence for temporary filenames instead of deriving them from the original filename.

Affected products

  • haxx curl 7.84.0 to 8.4.0
  • fedoraproject Fedora 38 8.0.1-6.fc38
  • fedoraproject Fedora 39 8.2.1-4.fc39
  • Debian Debian GNU/Linux 11 (bullseye) 7.74.0-1.3+deb11u11
  • Debian Debian GNU/Linux 12 (bookworm) 7.88.1-10+deb12u5

Timeline

  • 2023-11-02: disclosed: Reported to the curl project
  • 2023-12-06: patched: Fixed in curl version 8.5.0
  • 2023-12-06: advisory: Project curl security advisory published
  • 2023-12-12: advisory: NVD published CVE-2023-46219

References

Related threats