
NahamSec Demonstrates Session Hijacking Technique Exploiting Browser Vulnerability
In this video, NahamSec explores an ingenious technique for hijacking a user session by exploiting a vulnerability in browser behavior, particularly in Chrome. The attack relies on using an HTML image tag to inject an insecure referrer policy, forcing the browser to disclose sensitive information, including authentication tokens. The starting point of this demonstration is the explanation of how referrer headers work. When a user clicks on a link or loads a resource, the browser sends a referrer header indicating the origin of the request. By default, browsers limit the information sent to avoid disclosing sensitive data. However, by using a referrer policy set to "unsafe-url," it is possible to force the browser to send the full URL, including sensitive query parameters. NahamSec demonstrates this vulnerability using an OAuth flow, a protocol commonly used for authentication. OAuth flows often transmit tokens and user data via query parameters in the URL. If this information can be disclosed, an attacker can hijack the user's session. The demonstration shows how an attacker can inject an image tag with an insecure referrer policy to capture these sensitive tokens. To illustrate this attack, NahamSec uses a personal web server configured to serve an image with an insecure referrer policy. He shows how this image can be injected into a web page to capture authentication tokens when the user logs in. By capturing these tokens, the attacker can then use them to take control of the user's account. The video highlights the importance of securing OAuth flows and monitoring HTML injections, even in unexpected places like image tags. NahamSec encourages developers to be aware of this vulnerability and take measures to protect sensitive information in URLs. In conclusion, this session hijacking technique is a fascinating demonstration of how browser behaviors can be exploited for sophisticated attacks. NahamSec invites viewers to explore this vulnerability further and share their findings.