SASL password overflow via integer overflow
libcurl contains a buffer overrun in the SASL authentication code. The internal function `Curl_auth_create_plain_message` fails to correctly verify that the passed in lengths for name and password are not too long, then calculates a buffer size to allocate. On systems with a 32-bit `size_t`, the math to calculate the buffer size triggers an integer overflow when the username length exceeds 1GB and the password name length is close to 2GB in size. This integer overflow usually causes a tiny buffer to actually get allocated instead of the intended huge one, making the use of that buffer end up in a heap buffer overflow. (This bug is similar to [CVE-2018-14618](https://curl.se/docs/CVE-2018-14618.html).)
02 / AFFECTED SOFTWARE
Affected packages
41 explicit affected versions
84 explicit affected versions
03 / CONNECTIONS
Connected vulnerabilities
04 / EVIDENCE
Source records
Curl versions 7.33.0 through 7.61.1 are vulnerable to a buffer overrun in the SASL authentication code that may lead to denial of service.
libcurl contains a buffer overrun in the SASL authentication code. The internal function `Curl_auth_create_plain_message` fails to correctly verify that the passed in lengths for name and password are not too long, then calculates a buffer size to allocate. On systems with a 32-bit `size_t`, the math to calculate the buffer size triggers an integer overflow when the username length exceeds 1GB and the password name length is close to 2GB in size. This integer overflow usually causes a tiny buffer to actually get allocated instead of the intended huge one, making the use of that buffer end up in a heap buffer overflow. (This bug is similar to [CVE-2018-14618](https://curl.se/docs/CVE-2018-14618.html).)
05 / REFERENCES
Further evidence
- http://www.securitytracker.com/id/1042012
- https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16839
- https://curl.haxx.se/docs/CVE-2018-16839.html
- https://github.com/curl/curl/commit/f3a24d7916b9173c69a3e0ee790102993833d6c5
- https://lists.apache.org/thread.html/8338a0f605bdbb3a6098bb76f666a95fc2b2f53f37fa1ecc89f1146f%40%3Cdevnull.infra.apache.org%3E
- https://lists.debian.org/debian-lts-announce/2018/11/msg00005.html
- https://security.gentoo.org/glsa/201903-03
- https://usn.ubuntu.com/3805-1/
- https://www.debian.org/security/2018/dsa-4331