-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Description
In number of locations libcurl omits zeroing memory after it has been used to store a copy of a clear text password or derived key material. This doesn't have a direct security impact in normal circumstances, but may become one if application using libcurl has some flaw that allows heap or stack disclosure. One historical example of such issue is the infamous openssl heartbleed vulnerability.
I did this
- asked user for a password
- passed the password to libcurl
- afterwards securely
memset_sthe password to all 0 - dumped process memory
- looked for the password in memory and found copy of it
I expected the following
libcurl itself to wipe the passwords / key material after use.
curl/libcurl version
curl 7.77.1-DEV (x86_64-pc-linux-gnu) libcurl/7.77.1-DEV OpenSSL/1.1.1k zlib/1.2.11 brotli/1.0.9 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.3.0) libssh2/1.9.0 nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.4.57
Release-Date: [unreleased]
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli HSTS HTTP2 HTTPS-proxy IDN IPv6 Largefile libz NTLM NTLM_WB PSL SSL TLS-SRP UnixSockets
operating system
Linux hostname 5.10.0-6-amd64 #1 SMP Debian 5.10.28-1 (2021-04-09) x86_64 GNU/Linux
references
- Secure and kind of portable way to zero memory https://www.cryptologie.net/article/419/zeroing-memory-compiler-optimizations-and-memset_s/ -- the code could be improved to use
SecureZeroMemoryon windows