Bug 1399580 (CVE-2016-1251) - CVE-2016-1251 perl-DBD-MySQL: Use after free when using prepared statements
Summary: CVE-2016-1251 perl-DBD-MySQL: Use after free when using prepared statements
Alias: CVE-2016-1251
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
Depends On: 1399581 1405899
Blocks: 1399583
TreeView+ depends on / blocked
Reported: 2016-11-29 10:41 UTC by Adam Mariš
Modified: 2021-02-17 02:58 UTC (History)
9 users (show)

Fixed In Version: perl-DBD-MySQL 4.041
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2019-06-08 03:02:45 UTC

Attachments (Terms of Use)

Description Adam Mariš 2016-11-29 10:41:15 UTC
A use after free vulnerability when using prepared statements was found in DBD::mysql. Function dbd_st_fetch() via Renew() can reallocate output buffer for mysql_stmt_fetch() call, but it does not update pointer to that buffer in imp_sth->stmt structure initialized by mysql_stmt_bind_result() function, which leads to use after free in any mysql function which access imp_sth->stmt structure.

This vulnerability is present in all releases at least back to versions 3.0 of the driver, which were released in 2005.

Upstream patch:




Comment 1 Adam Mariš 2016-11-29 10:41:44 UTC
Created perl-DBD-MySQL tracking bugs for this issue:

Affects: fedora-all [bug 1399581]

Comment 7 Dhiru Kholia 2017-01-04 05:04:33 UTC

This problem is only exposed when the user uses server-side prepared statement support (mysql_server_prepare=1), which is NOT default behavior and was turned off back for all drivers per MySQL AB decision in 2006 due to issues with server-side prepared statements in the server.

Use the default driver setting which uses emulated prepared statements.

Note You need to log in before you can comment on or make changes to this bug.