How we Broke PHP, Hacked Pornhub and Earned $20,000
페이지 정보

본문
We have now discovered two use-after-free vulnerabilities in PHP’s rubbish collection algorithm. Those vulnerabilities have been remotely exploitable over PHP’s unserialize operate. We have been 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 relatively excessive rewards on Hackerone caught our attention. That’s why we've got taken the perspective of a sophisticated attacker with the complete intent to get as deep as doable into the system, focusing on one most important goal: gaining remote code execution capabilities. Thus, we left no stone unturned and attacked what Pornhub is constructed upon: PHP. After analyzing the platform we rapidly detected the utilization of unserialize on the website. In all circumstances a parameter named "cookie" got unserialized from Post data and afterwards reflected by way of Set-Cookie headers. Standard exploitation methods require so called Property-Oriented-Programming (POP) that contain abusing already present classes with specifically defined "magic methods" so as to trigger unwanted and malicious code paths.
Unfortunately, it was troublesome for us to collect any details about Pornhub’s used frameworks and PHP objects generally. Multiple courses from frequent frameworks have been tested - all with out success. The core unserializer alone is relatively complicated as it involves greater than 1200 lines of code in PHP 5.6. Further, many internal PHP courses have their own unserialize methods. By supporting structures like objects, arrays, integers, strings or even references it is not any surprise that PHP’s track record exhibits a tendency for bugs and memory corruption vulnerabilities. Sadly, there have been no recognized vulnerabilities of such sort for newer PHP versions like PHP 5.6 or PHP 7, particularly as a result of unserialize already received numerous consideration in the past (e.g. phpcodz). Hence, auditing it may be in comparison with squeezing an already tightly squeezed lemon. Finally, after so much consideration and so many security fixes its vulnerability potential should have been drained out and it ought to be secure, shouldn’t it? To search out a solution Dario applied a fuzzer crafted particularly for fuzzing serialized strings which had been handed to unserialize.
Running the fuzzer with PHP 7 immediately result in unexpected behavior. This conduct was not reproducible when examined towards Pornhub’s server although. Thus, we assumed a PHP 5 version. However, running the fuzzer in opposition to a newer model of PHP 5 just generated more than 1 TB of logs without any success. Eventually, after putting more and more effort into fuzzing we’ve stumbled upon unexpected habits once more. Several questions needed to be answered: is the issue security associated? In that case can we only exploit it regionally or also remotely? To additional complicate this case the fuzzer did generate non-printable information blobs with sizes of more than 200 KB. An incredible amount of time was essential to investigate potential points. In any case, we might extract a concise proof of idea of a working memory corruption bug - a so known as use-after-free vulnerability! Upon additional investigation we found that the basis trigger may very well be found in PHP’s garbage collection algorithm, a element of PHP that is completely unrelated to unserialize.
However, the interplay of each elements occurred solely after unserialize had completed its job. Consequently, it was not nicely suited to remote exploitation. After further evaluation, gaining a deeper understanding for the problem’s root causes and lots of hard work the same use-after-free vulnerability was discovered that gave the impression to be promising for distant exploitation. The high sophistication of the discovered PHP bugs and their discovery made it crucial to jot down separate articles. You can read extra particulars in Dario’s fuzzing unserialize write-up. As well as, we now have written an article about Breaking PHP’s Garbage Collection and Unserialize. Even this promising use-after-free vulnerability was considerably troublesome to take advantage of. Particularly, it involved a number of exploitation stages. 1. The stack and heap (which additionally embrace any potential user-enter) in addition to some other writable segments are flagged non-executable (c.f. 2. Even if you are able to regulate the instruction pointer it's good to know what you wish to execute i.e. it's essential have a legitimate deal with of an executable memory phase.
- 이전글Team Soda SEO Expert San Diego 24.05.29
- 다음글10 Undeniable Details About Watch Free Poker TV Shows 24.05.29
댓글목록
등록된 댓글이 없습니다.