A modern, secure-by-design application
The new platform incorporated OWASP controls, strong session handling, and server-side validation throughout. On paper, it met or exceeded best practice. :contentReference[oaicite:1]{index=1}
Uncovering hidden trust weaknesses in OAuth2 authentication and securing a mission-critical trading platform.
A Europe-wide financial services organisation was preparing to launch a new version of its commodities exchange platform. The application, built in Ruby with security baked in from the start, had undergone internal code review and adhered to all known OWASP recommendations. It relied on Google OAuth2 for authentication, permitting users to access the trading platform using corporate Google accounts.
Despite the high level of confidence in the design, Cyber Defence was engaged for a final pre-launch penetration test — a decision that proved critical. What followed demonstrated how even well-engineered authentication mechanisms can be undermined when third-party trust boundaries are not fully understood.
Challenge
The new platform incorporated OWASP controls, strong session handling, and server-side validation throughout. On paper, it met or exceeded best practice. :contentReference[oaicite:1]{index=1}
Users authenticated via Google credentials, delegating trust to Google’s identity provider.
The application would soon be used by real traders and held sensitive market data with strict uptime and security requirements.
Cyber Defence’s penetration testers began by analysing the data flow between browser and server, focusing on the trust relationship between Google’s OAuth2 identity output and the application’s own logic. All conventional entry points (login forms, business logic, workflows) were found to be robust.
So we targeted the one component developers often assume can be trusted: identity attributes returned from the OAuth provider. :contentReference[oaicite:2]{index=2}
Method
We modified first and last name values within the OAuth2 identity payload, injecting benign XSS markers followed by SQL syntax to test server-side validation.
The application returned unusual errors when sanitisation failed, confirming an exploitable SQL injection pathway originating from the trusted Google profile fields. :contentReference[oaicite:3]{index=3}
With the injection point confirmed, we crafted SQL payloads targeting user tables and authentication data.
By carefully injecting SQL into the first-name field, Cyber Defence extracted the platform’s administrator user table — including usernames and password hashes. This alone represented a significant compromise.
But access to the admin account required secondary two-factor authentication, so our team moved on to the challenge of bypassing it. :contentReference[oaicite:4]{index=4}
Bypassing MFA
Earlier in the year, Google had patched an issue where Application-Specific Passwords could bypass 2-Step Verification entirely — but even after the fix, ASPs still allowed extensive account interaction. :contentReference[oaicite:5]{index=5}
Using <code>https://accounts.google.com/MergeSession</code>, we generated a session pivot enabling partial reuse of identity tokens.
Chrome stored the OAuth2 refresh token in plaintext under the user’s profile preferences:<br><br><code>"oauth2LoginRefreshToken": {"status": "Successful", "value": "vdb_4dm1n_100212"}</code><br><br>With this token, we successfully sidestepped the second authentication step and logged in as the administrator. :contentReference[oaicite:6]{index=6}
Impact
From a third-party trust boundary flaw, we achieved full administrative access to the commodities exchange platform.
Administrators controlled market data, trading workflows, and system configuration — potential for financial harm was significant.
Trust in Google’s OAuth2 identity attributes created a blind spot in server-side input validation.
Cyber Defence provided concrete recommendations, including:
• full server-side validation of all OAuth-supplied identity attributes
• strict separation of authentication source and application trust boundaries
• improved sanitisation routines for names, emails, and user profile data
• monitoring and alerting for identity anomalies
• safer handling of OAuth refresh tokens
The client remediated the issues within one week. A free retest by Cyber Defence confirmed that the vulnerabilities were fully resolved and the application was secure for production launch.
Cyber Defence specialises in testing complex authentication systems, OAuth/OIDC integrations, mobile application flows, cloud identity boundaries, and business-critical financial platforms.
If your application relies on third-party identity providers, ensure the trust chain is truly secure.