curl_getdate read out of bounds
The `curl_getdate` converts a given date string into a numerical timestamp and it supports a range of different formats and possibilities to express a date and time. The underlying date parsing function is also used internally when parsing for example HTTP cookies (possibly received from remote servers) and it can be used when doing conditional HTTP requests. The date parser function uses the libc `sscanf()` function at two places, with the parsing strings `%02d:%02d` and `%02d:%02d:%02d`. The intent being that it would parse either a string with HH:MM (two digits colon two digits) or `HH:MM:SS` (two digits colon two digits colon two digits). If instead the piece of time that was sent in had the final digit cut off, thus ending with a single-digit, the date parser code would advance its read pointer one byte too much and end up reading out of bounds.
02 / AFFECTED SOFTWARE
Affected packages
139 explicit affected versions
161 explicit affected versions
03 / CONNECTIONS
Connected vulnerabilities
04 / EVIDENCE
Source records
The `curl_getdate` function in curl before version 7.51.0 is vulnerable to an out of bounds read if it receives an input with one digit short.
The `curl_getdate` converts a given date string into a numerical timestamp and it supports a range of different formats and possibilities to express a date and time. The underlying date parsing function is also used internally when parsing for example HTTP cookies (possibly received from remote servers) and it can be used when doing conditional HTTP requests. The date parser function uses the libc `sscanf()` function at two places, with the parsing strings `%02d:%02d` and `%02d:%02d:%02d`. The intent being that it would parse either a string with HH:MM (two digits colon two digits) or `HH:MM:SS` (two digits colon two digits colon two digits). If instead the piece of time that was sent in had the final digit cut off, thus ending with a single-digit, the date parser code would advance its read pointer one byte too much and end up reading out of bounds.
05 / REFERENCES
Further evidence
- http://www.oracle.com/technetwork/security-advisory/cpuoct2018-4428296.html
- http://www.securityfocus.com/bid/94101
- http://www.securitytracker.com/id/1037192
- https://access.redhat.com/errata/RHSA-2018:2486
- https://access.redhat.com/errata/RHSA-2018:3558
- https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2016-8621
- https://curl.haxx.se/CVE-2016-8621.patch
- https://curl.haxx.se/docs/adv_20161102G.html
- https://security.gentoo.org/glsa/201701-47
- https://www.tenable.com/security/tns-2016-21