Description
MySQL 4.0.23 and earlier, and 4.1.x up to 4.1.10, allows remote authenticated users with INSERT and DELETE privileges to execute arbitrary code by using CREATE FUNCTION to access libc calls, as demonstrated by using strcat, on_exit, and exit.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 3.0 | mysql | 3.23.49-8.11 | DSA-707-1 |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 4 | mysql +3 | 4.1.10a-1.RHEL4.1 | RHSA-2005:334 |
| RHEL 3 | mysql +2 | 3.23.58-15.RHEL3.1 | RHSA-2005:334 |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
Exploit-DB 1
- MySQL 4.x - CREATE FUNCTION Arbitrary libc Code Execution EDB-25209 · remote · Mar 11, 2005 · verified
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Advisories 2
- RHSA-2005:334 Red Hat Security Advisory: mysql security update Red Hat Security Advisories (RHSA) · Jun 29, 2026
- DSA-707-1 mysql - several Debian Security (DSA / DLA) · Mar 9, 2026
References
- 2005-0009 vendor-advisory
- DSA-707 vendor-advisory
- 20050310 Mysql CREATE FUNCTION libc arbitrary code execution. mailing-list
- 20050310 Mysql CREATE FUNCTION libc arbitrary code execution. mailing-list
- RHSA-2005:334 vendor-advisory
- 101864 vendor-advisory
- SUSE-SA:2005:019 vendor-advisory
- USN-96-1 vendor-advisory
- RHSA-2005:348 vendor-advisory
- APPLE-SA-2005-08-15 vendor-advisory
- MDKSA-2005:060 vendor-advisory
- GLSA-200503-19 vendor-advisory
- oval:org.mitre.oval:def:10479 vdb-entry signature
- APPLE-SA-2005-08-17 vendor-advisory
- 12781 vdb-entry