People often ask me "How did you learn how to hack?" The answer: by reading. This page is a collection of the blog posts and other articles that I have accumulated over the years of my journey. Enjoy!
verify_purchase endpoint (which contains information from the payment in Google) there existing a Time of Check vs. Time of Use (TOCTOU) vulnerability. There is verification being done. However, by making the same request several times concurrently, the money gets added multiple times. securityLevel configuration cannot be strict. If we could get HTML into this, we could likely take this to XSS.flowchart.htmlLabels as the string "false" (not the boolean), we can bypass this allowlist since the string is being evaluated for existence instead of a boolean. We use "false" to get it through the allowlist.flowchart.htmlLabels is set to some value, we can get the variable controlling it set to true. With this, the labels will now render the HTML directly, resulting in the injecting of HTML. But, what about JavaScript?Content-Type. Since the JS is now on the Gitlab domain, it believes that this JavaScript code is coming from the same domain as the page. This satisfies the CSP.innerHTML does not accept <script> tags. Instead, we pass the script directly into an iframe srcdoc to get XSS on the page. flowchart.htmlLabels directive, which would prevent this attack. Secondly, they should not allow for potentially malicious Content-Types from the Workhouse. Finally, they mention that HTMLlabels should not be possible anyway. anti-script settings should block all script execution. But, the author found multiple ways around this quickly, not even including the bug mentioned above. In reality, the project could use an upgrade on the code quality. TdxIssueIoControlRequest function accepts codes but does not do the validation. This is labeled as the first vulnerability. _members field is used that maps the name of an attribute to their index in one of these arrays. _members field is used. This bitflag is set at 0x02000000. Bitflags being held in a used value is similar to the size in the chunks in glibc malloc. Is the usage of the bitflag done securely? 0x02000000, could we create a class definition with 0x02000000 methods or variables? If we add 0x02000000 methods, then try to get this as a variable, the program will immediately crash! We have got a type confusion vulnerability. value accessor to write and read values IF we can create a proper fake object (lots of misdirection). _value to retrieve an array type. By using a OOB access, we could control the base address and the amount of entries in the array. Now, by reading or writing to this, we have a beautiful arbitrary read/arbitrary write primitive. CPDField of a PDF are internal AcroForm.api C++ objects used to represent text fields, buttons and many other things. In the POC, there is a CPDField object that is a child of another object. When doing this and calling JavaScript on the parent with a callback that has state changing actions on the child, we crash. But why?CPDField has an internal property called LockFieldProp in order to prevent concurrent access issues. This field is checked every time some change is happening on the object. However, when using a custom callback on (like mentioned above) a recursive call can be made that can free the child object, since it was never locked. CPDField is easy to control via a heap spray of similarly sized objects. Once the freed CPDField has been swapped out with an object that we control, it is now gameover! The POC submitted to ZDI, once dereferenced, demonstrated control of a virtual function pointer. open(subscribe_url). The open function in Ruby can be injected into for OS command injection. .pem extension. Since we do not control the PEM file going in from SNS, this causes us issues. .pem file. Could this verification by bypassed? GetEndpointAttributes has a field called CustomUserData. By using this endpoint, it was possible to create a valid X509 certificate that would be returned from the API. SubscribeURL on the message being sent with the certificate could be used for command injection. At this point, we could pop a shell on the Discourse instance, even though we clearly should not be able to!SIGSEGV. The coredump can be used to explore the memory of the process at the time of a crash.dumpable property. This is used to determine whether to generate a core file for a crashing process. There are three values for this:
setuid. Of course, we do not want a coredump to occur, as this could leaks secrets from the program. In order to prevent this from happening, the dumpable value of a setuid binary should be set to 0 instead of 1 at process creation.dumpable attribute is set to 0. sudo (in some non-standard configurations) was a good candidate. In some setups of sudo, all users can execute a binary as any other user. In the example they use true, which has literally no logic what-so-ever. When true is executed via sudo, the fork call does NOT drop permissions. Because true does not have the setuid bit, the dumpable value is set to 1 when we execute this. SIGQUIT will stop the process immediately and trigger a coredump. XAUTHORITY ENV variable. By including information into this (that we control), we can control part of the coredump that we are writing. XAUTHORITY to be executed. /etc/logrotate. Now, the coredump will occur here.
SIGQUIT signal or playing with the CPUs.su which will eventually use several external binaries. A code path that does this can be reached only if SELinux is enabled. By using the same method as before with su and the PAM modules, a coredump can be put into logrotate to execute code down the code. coredumps are an important part of Linux debugging that need to be created. This post used a subtle quirk in the checking of the dumpable property (that is NOT trivial to fix) and expected functionality for crashing binaries in order to cause a coredump in a bad place. mg_handle_form_request is used for uploading the files. The code has directory traversal (../) sanitization. However, there is a logic bug in the compilation that is platform dependent. The logic for protecting works ONLY on Windows builds. As a result, OSX and Linux builds are vulnerable to this attack. else simply checks that the string does not contain a '&'. In reality, this code SHOULD have bene checking for a backslash '/' instead of this. phone_number and the country_isd. The phone number is obvious but the country_isd is not; it is simply the prefix for the country of the phone. For instance, the US is '+1'.
country_isd did not. Since this was prepended to the phone number, we could edit the phone number that was actually being used with the SMS service!country_isd to a full phone then adding a comma, another number can be added! For instance, if the phone number was 9999999999, and the validated number was 8888888888 the new number would be 9999999999,8888888888. Since the number is sent to both numbers, the attacker has a valid OTP.