Skip to content

fix: remove extract($_GET) variable overwrite in legacy_auth.php - #106

Open
hacktron-app-stg[bot] wants to merge 1 commit into
add-legacy-auth-phpfrom
hacktron/fix-fb26269d
Open

fix: remove extract($_GET) variable overwrite in legacy_auth.php#106
hacktron-app-stg[bot] wants to merge 1 commit into
add-legacy-auth-phpfrom
hacktron/fix-fb26269d

Conversation

@hacktron-app-stg

Copy link
Copy Markdown

Vulnerability

legacy_auth.php called extract($_GET) at line 16, importing every request parameter into the local variable scope. Because $authenticated is a local variable, an attacker could overwrite it by supplying ?authenticated=1, bypassing authentication entirely and causing the script to output welcome admin.

  • Category: Variable Overwrite via extract() (high)
  • Sink: legacy_auth.php:16

Fix

Removed the extract($_GET) call. The $authenticated flag is now derived exclusively from the server-side session ($_SESSION['auth']), which is set only when a valid token is presented. Request parameters can no longer influence the authentication decision. A comment documents why extract($_GET) must not be reintroduced.

Verification

Reviewed the data flow: the only prior writer of $authenticated was the extract($_GET) line; after removal, its value comes only from the session. PHP is not available in the sandbox, so php -l could not be run, but the edit is a minimal, self-contained change to a single statement. No regression test was added since the repository has no test infrastructure.


Automated fix by Hacktron for finding: https://staging.hacktron.ai/testestesttest/findings/fb26269d-a9f2-4555-96ca-fff93f94a728

Replace extract($_GET) with session-derived authentication state so an
attacker can no longer set $authenticated via ?authenticated=1.
@hacktron-app-stg
hacktron-app-stg Bot requested a review from maekuss July 23, 2026 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants