Summary
OpenMage's OAuth confirmation actions may accept GET requests without validating a form key, allowing a cross-site request forgery attack. If an attacker has OAuth consumer credentials and can lure a logged-in administrator or customer to a crafted confirmation URL, the victim may authorize the attacker's request token, which can then be exchanged for a persistent REST API access token.
Affected context
The issue affects OpenMage Magento LTS releases before 20.18.2 and 21.0.0-beta1 releases before 21.0.0-beta3. It occurs in the admin and storefront OAuth confirm and confirmSimple actions when they accept GET requests without form-key validation.
Exploit preconditions
- Attack surface: Admin or storefront OAuth confirmation endpoints
- Required access: The attacker needs OAuth consumer credentials; the victim must be logged in when visiting the crafted URL
- Trigger point: The victim's browser sends a GET request to a confirmation action
- Why exploitation is possible: The action can authorize the attacker's request token without validating a form key or equivalent CSRF protection
Why this happens
The confirmation actions perform a security-sensitive state change through GET requests without checking a CSRF token. Because a browser may send such a request in the context of an authenticated session, an attacker can potentially cause a victim to authorize an OAuth request token. This is CWE-352: Cross-Site Request Forgery.
Potential impact
- An attacker could obtain a persistent REST API access token associated with the victim
- The token may allow unauthorized API actions within the victim's granted permissions
- Depending on the victim's role and account access, sensitive data could be exposed or modified
General mitigation guidance
Defensive patterns focus on protecting state-changing OAuth actions and limiting the authority of issued tokens:
- Require POST for authorization actions that change state, and validate a session-bound CSRF token
- Use secure-by-default request handling that rejects state changes through GET
- Bind OAuth authorization to the intended consumer, request token, session, and explicit user consent
- Apply least-privilege scopes and appropriate expiration or revocation controls to access tokens
- Treat browser-originated requests as untrusted unless the required authorization checks pass
How teams detect issues like this
- Use static analysis to identify state-changing handlers reachable through GET and missing CSRF validation
- Review OAuth confirmation flows for form-key checks, session binding, and explicit consent enforcement
- Test that cross-origin requests cannot authorize request tokens in authenticated sessions
- Apply security policies that require CSRF protection for browser-accessible state changes
- Automated code review tools may help flag unsafe HTTP method handling and missing request validation

