Pentest Chronicles
Let’s begin by explaining some tech jargon:
Vulnerability Chain: Think of this as a domino effect. Multiple connected vulnerabilities can culminate into a serious one. A prime example is a reflected cross-site scripting (XSS) attack. On its own, it’s often considered as medium severity. However, when combined with cookies without the appropriate security flags, it can escalate to an account takeover.
Cache Mechanism: Developers use this to store data “closer” to the user, thus preventing them from loading it directly from the database. This mechanism saves significant resources, especially when thousands of users are simultaneously active. The cache can be set either individually or shared among users.
Application Features: These are functionalities added to the application to enhance the user experience. For instance, when you type a word into a search engine, it offers suggestions for the next word, such as “the most interesting…”, “the most fascinating…”, and so on.
So, what went wrong in the tested application?Why was a Mass Account Takeover a real scenario?
During the application audit, one of our test methodologies involved identifying application parameters and monitoring their behavior within the application environment. Imagine a parameter called SEARCH. Naturally, we’d check if this parameter was vulnerable to SQL injection, XSS, server-side request forgery (SSRF), server-side template injection (SSTI), and so on. We started with a basic check for the reflected value.
The auditor sends the server a TEST value for the SEARCH parameter.
REQUEST:
GET /?SEARCH=TEST HTTP/2
Host: […REDACTED-HOST…]
User-Agent: […REDACTED…]
…
RESPONSE:
HTTP/2 200 OK
…
[APPLICATION SOURCE CODE]
TEST
[APPLICATION SOURCE CODE]
…
If the application returns the TEST value in the response body, that’s important information for the auditor (in black box tests, auditors do not know what parameters are processed by the application – we are learning how the application works, how a hacker would behave in a real attack scenario). Now it’s time to test more advanced payloads, such as: <script>alert(document.domain)</script>
GET /?SEARCH=><script>alert(document.domain)</script> HTTP/2
Host: […REDACTED-HOST…]
User-Agent: […REDACTED…]
…
HTTP/2 200 OK
…
[SOURCE CODE OF APPLICATION]
><script>alert(document.domain)</script>
[SOURCE CODE OF APPLICATION]
…
Everything seemed okay. The SEARCH parameter appeared to be sanitized, so the auditor moved on to another parameter. However, the story took an unexpected turn. What happens if the exact same request is repeated?
GET /?SEARCH=><script>alert(document.domain)</script> HTTP/2
Host: […REDACTED-HOST…]
User-Agent: […REDACTED…]
…
RESPONSE:
HTTP/2 200 OK
…
[APPLICATION SOURCE CODE]
><script>alert(document.domain)</script>
[APPLICATION SOURCE CODE]
…
Why might an application behave like this if the first response was correctly sanitized, but the second one allows arbitrary JavaScript code execution? This is due to a BROKEN CACHE mechanism. In the tested application, the cache mechanism worked individually for each user, making it impossible to poison the cache for all users. So how is this even exploitable? In today's world, ensuring the security of our accounts is more crucial than ever. Just as keys protect the doors to our homes, passwords serve as the first line of defense for our data and assets. It's easy to assume that technical individuals, such as developers and IT professionals, always use strong, unique passwords to keep ...
SOCMINT is the process of gathering and analyzing the information collected from various social networks, channels and communication groups in order to track down an object, gather as much partial data as possible, and potentially to understand its operation. All this in order to analyze the collected information and to achieve that goal by making …
PyScript – or rather Python in your browser + what can be done with it? A few days ago, the Anaconda project announced the PyScript framework, which allows Python code to be executed directly in the browser. Additionally, it also covers its integration with HTML and JS code. An execution of the Python code in …