Missing State Parameter
Account Takeover by Insecure State Parameter
Overview of the Vulnerability
OAuth is an authorization framework used to identify and authenticate users for an application. There are a number of implementation misconfigurations which can lead to an OAuth framework being implemented insecurely that an attacker can leverage to take over multiple user accounts and manipulate or retrieve data.
A misconfigured or missing state parameter allows an attacker to issue a request on behalf of a user and trick the user’s browser into completing the OAuth workflow, similar to a Cross-Site Request Forgery (CSRF) attack. This can enable an attacker to take over multiple accounts in the application depending on the OAuth workflow configuration.
Business Impact
Account takeover can lead to financial and loss through an attacker's access to multiple user accounts and the data within. This attack can also lead to reputational damage for the business through the impact to customers’ trust in the security of the application.
Steps to Reproduce
Enable a HTTP intercept proxy, such as Burp Suite or OWASP ZAP
Use a browser to login and navigate to: {{URL}}
Capture the response with the HTTP intercept proxy turned on
Observe the insecure
stateparameterChange
stateto the following value:
{{parameter}}
Forward the following vulnerable request to the application:
Observe that it is now possible to take over a user’s account
Proof of Concept (PoC)
The screenshot below demonstrates a successful account takeover:
{{screenshot}}
Recommendation(s)
There is no single technique to stop OAuth misconfigurations from occurring. However, securely implementing the OAuth workflow with the right combination of defensive measures can prevent and limit the impact of these OAuth misconfigurations. Some best practices include the following:
Ensure that parameters within the OAuth workflows are validated
Enable Cross-Site Request Forgery (CSRF) validation on endpoints
Thoroughly validate input and use other preventative controls to limit Cross-Site Scripting (XSS). See the Open Web Application Security Project’s (OWASP) XSS prevention cheat sheet for more details: https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html
Last updated