How we Broke PHP, Hacked Pornhub and Earned $20,000
페이지 정보
본문
We have now found two use-after-free vulnerabilities in PHP’s garbage collection algorithm. Those vulnerabilities had been remotely exploitable over PHP’s unserialize perform. We had 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 high rewards on Hackerone caught our attention. That’s why we have now taken the attitude of a complicated attacker with the complete intent to get as deep as potential into the system, specializing in one predominant objective: gaining remote 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 utilization of unserialize on the web site. In all cases a parameter named "cookie" received unserialized from Post information and afterwards mirrored through Set-Cookie headers. Standard exploitation techniques require so known as Property-Oriented-Programming (POP) that involve abusing already present courses with particularly outlined "magic methods" to be able to set off unwanted and malicious code paths.
Unfortunately, it was tough for us to gather any details about Pornhub’s used frameworks and PHP objects basically. Multiple lessons from common frameworks have been tested - all with out success. The core unserializer alone is comparatively complicated because it entails greater than 1200 strains of code in PHP 5.6. Further, many inside PHP lessons have their very own unserialize strategies. By supporting constructions like objects, arrays, integers, strings or even references it is not any surprise that PHP’s observe report exhibits a tendency for bugs and reminiscence corruption vulnerabilities. Sadly, there have been no known vulnerabilities of such kind for newer PHP variations like PHP 5.6 or PHP 7, especially because unserialize already acquired plenty of consideration prior to now (e.g. phpcodz). Hence, auditing it may be in comparison with squeezing an already tightly squeezed lemon. Finally, after a lot attention and so many safety fixes its vulnerability potential should have been drained out and it must be secure, porn shouldn’t it? To seek out a solution Dario implemented a fuzzer crafted particularly for fuzzing serialized strings which were handed to unserialize.
Running the fuzzer with PHP 7 immediately result in unexpected conduct. This conduct was not reproducible when examined towards Pornhub’s server although. Thus, we assumed a PHP 5 version. However, running the fuzzer against a newer model of PHP 5 simply generated more than 1 TB of logs with none success. Eventually, after putting more and more effort into fuzzing we’ve stumbled upon unexpected conduct again. Several questions had to be answered: is the difficulty security related? If so can we only exploit it locally or additionally remotely? To further complicate this case the fuzzer did generate non-printable data blobs with sizes of more than 200 KB. An incredible amount of time was necessary to analyze potential issues. In spite of everything, we may extract a concise proof of idea of a working reminiscence corruption bug - a so referred to as use-after-free vulnerability! Upon further investigation we discovered that the root cause could be present in PHP’s garbage collection algorithm, a component 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 well suited to remote exploitation. After additional analysis, gaining a deeper understanding for the problem’s root causes and plenty of laborious work an identical use-after-free vulnerability was discovered that gave the impression to be promising for remote exploitation. The excessive sophistication of the discovered PHP bugs and their discovery made it needed to put in writing separate articles. You can learn extra details in Dario’s fuzzing unserialize write-up. In addition, we have written an article about Breaking PHP’s Garbage Collection and Unserialize. Even this promising use-after-free vulnerability was significantly tough to exploit. Specifically, it involved multiple exploitation phases. 1. The stack and heap (which additionally embody any potential consumer-enter) as well as any other writable segments are flagged non-executable (c.f. 2. Even in case you are ready to regulate the instruction pointer it is advisable to know what you wish to execute i.e. it's essential have a legitimate tackle of an executable reminiscence section.
- 이전글емлелік қателерді түзету жолдары - орфографиялық жаттығулар 24.05.30
- 다음글The Next Big Event In The Adult Toys For Men Industry 24.05.30
댓글목록
등록된 댓글이 없습니다.