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

페이지 정보

profile_image
작성자
댓글 0건 조회 21회 작성일 24-05-30 22:53

본문

2000x2000.8.jpgNow we have found two use-after-free vulnerabilities in PHP’s garbage collection algorithm. Those vulnerabilities were remotely exploitable over PHP’s unserialize operate. 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 text. Pornhub’s bug bounty program and its comparatively excessive rewards on Hackerone caught our consideration. That’s why we've taken the perspective of an advanced attacker with the complete intent to get as deep as attainable into the system, specializing in one essential purpose: gaining distant code execution capabilities. Thus, we left no stone unturned and attacked what Pornhub is constructed upon: PHP. After analyzing the platform we shortly detected the utilization of unserialize on the web site. In all instances a parameter named "cookie" got unserialized from Post information and afterwards mirrored through Set-Cookie headers. Standard exploitation strategies require so called Property-Oriented-Programming (POP) that involve abusing already existing classes with specifically defined "magic methods" in an effort to set off undesirable and malicious code paths.



s-l1200.webpUnfortunately, it was tough for us to collect any information about Pornhub’s used frameworks and PHP objects normally. Multiple lessons from common frameworks have been tested - all without success. The core unserializer alone is relatively complicated as it includes more than 1200 traces of code in PHP 5.6. Further, many inner PHP courses have their very own unserialize methods. By supporting buildings like objects, arrays, integers, strings or even references it is no shock that PHP’s track report shows a tendency for bugs and reminiscence corruption vulnerabilities. Sadly, there have been no known vulnerabilities of such type for newer PHP versions like PHP 5.6 or PHP 7, particularly because unserialize already acquired lots of attention prior to now (e.g. phpcodz). Hence, auditing it can be compared to squeezing an already tightly squeezed lemon. Finally, after a lot attention and so many security fixes its vulnerability potential ought to 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 have been passed to unserialize.



Running the fuzzer with PHP 7 instantly result in unexpected habits. This conduct was not reproducible when tested towards Pornhub’s server although. Thus, we assumed a PHP 5 model. However, running the fuzzer in opposition to a newer model of PHP 5 simply generated greater than 1 TB of logs without any success. Eventually, xhamster after placing increasingly more effort into fuzzing we’ve stumbled upon unexpected behavior again. Several questions had to be answered: is the problem safety related? If that's the case can we only exploit it domestically or also remotely? To additional complicate this case the fuzzer did generate non-printable data blobs with sizes of greater than 200 KB. An amazing amount of time was obligatory to investigate potential issues. In spite of everything, 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 foundation trigger could possibly be present in PHP’s garbage collection algorithm, a component of PHP that is totally unrelated to unserialize.



However, the interplay of both components occurred solely after unserialize had finished its job. Consequently, it was not effectively suited to distant exploitation. After additional analysis, gaining a deeper understanding for the problem’s root causes and plenty of arduous work the same use-after-free vulnerability was discovered that gave the impression to be promising for distant exploitation. The high sophistication of the found PHP bugs and their discovery made it vital to write separate articles. You possibly can read more details in Dario’s fuzzing unserialize write-up. In addition, now we have written an article about Breaking PHP’s Garbage Collection and Unserialize. Even this promising use-after-free vulnerability was significantly tough to use. In particular, it concerned multiple exploitation levels. 1. The stack and heap (which also embrace any potential consumer-input) as well as any other writable segments are flagged non-executable (c.f. 2. Even in case you are able to control the instruction pointer you must know what you wish to execute i.e. you need to have a sound tackle of an executable reminiscence segment.

댓글목록

등록된 댓글이 없습니다.

회원로그인

회원가입