How we Broke PHP, Hacked Pornhub and Earned $20,000

페이지 정보

profile_image
작성자 Felicitas Godwi…
댓글 0건 조회 67회 작성일 24-05-28 16:41

본문

360_F_314700448_Ckh3uDxLuKEwPNGHIKF1ZgRwuVStqSft.jpgWe have now found two use-after-free vulnerabilities in PHP’s garbage assortment algorithm. Those vulnerabilities had been remotely exploitable over PHP’s unserialize perform. We were also awarded with $2,000 by the Internet Bug Bounty committee (c.f. Many thanks exit to cutz for co-authoring this article. Pornhub’s bug bounty program and its comparatively excessive rewards on Hackerone caught our consideration. That’s why we've got taken the attitude of a sophisticated attacker with the complete intent to get as deep as doable into the system, focusing on one main aim: gaining distant code execution capabilities. Thus, we left no stone unturned and attacked what Pornhub is built upon: PHP. After analyzing the platform we quickly detected the usage of unserialize on the website. In all instances a parameter named "cookie" received unserialized from Post knowledge and afterwards reflected via Set-Cookie headers. Standard exploitation strategies require so called Property-Oriented-Programming (POP) that involve abusing already present lessons with specifically outlined "magic methods" as a way to set off unwanted and malicious code paths.



b9404ca05d4b26a9c18a3f4577b1b9da.10.jpgUnfortunately, it was troublesome for us to assemble any details about Pornhub’s used frameworks and PHP objects in general. Multiple classes from frequent frameworks have been tested - all without success. The core unserializer alone is relatively complex as it involves more than 1200 traces of code in PHP 5.6. Further, many inside PHP classes have their very own unserialize methods. By supporting structures like objects, arrays, integers, strings and even references it is not any surprise that PHP’s observe document reveals a tendency for bugs and memory corruption vulnerabilities. Sadly, there have been no identified vulnerabilities of such type for newer PHP variations like PHP 5.6 or PHP 7, particularly as a result of unserialize already acquired numerous consideration prior to now (e.g. phpcodz). Hence, auditing it may be in comparison with squeezing an already tightly squeezed lemon. Finally, xnxx after a lot consideration and so many safety fixes its vulnerability potential should have been drained out and it ought to be safe, shouldn’t it? To seek out an answer Dario implemented a fuzzer crafted particularly for fuzzing serialized strings which have been handed to unserialize.



Running the fuzzer with PHP 7 instantly lead to unexpected conduct. This habits was not reproducible when examined against Pornhub’s server though. Thus, we assumed a PHP 5 model. However, running the fuzzer towards a newer model of PHP 5 just generated greater than 1 TB of logs without any success. Eventually, after placing increasingly effort into fuzzing we’ve stumbled upon unexpected habits again. Several questions needed to be answered: is the issue security associated? In that case can we solely exploit it locally or also remotely? To further complicate this example the fuzzer did generate non-printable data blobs with sizes of greater than 200 KB. An incredible period of time was mandatory to investigate potential issues. In any case, we could extract a concise proof of idea of a working memory corruption bug - a so referred to as use-after-free vulnerability! Upon further investigation we found that the root cause could be present in PHP’s garbage collection algorithm, a element of PHP that is totally unrelated to unserialize.



However, the interaction of both elements occurred solely after unserialize had finished its job. Consequently, it was not properly suited for distant exploitation. After additional analysis, gaining a deeper understanding for the problem’s root causes and quite a lot of arduous work a similar use-after-free vulnerability was found that appeared to be promising for remote exploitation. The excessive sophistication of the found PHP bugs and their discovery made it obligatory to put in writing separate articles. You may read more particulars in Dario’s fuzzing unserialize write-up. As well as, now we have written an article about Breaking PHP’s Garbage Collection and Unserialize. Even this promising use-after-free vulnerability was significantly troublesome to use. Specifically, it concerned multiple exploitation stages. 1. The stack and heap (which also embrace any potential consumer-input) in addition to some other writable segments are flagged non-executable (c.f. 2. Even in case you are in a position to regulate the instruction pointer you have to know what you want to execute i.e. it's good to have a valid handle of an executable memory segment.

댓글목록

등록된 댓글이 없습니다.