Note: Made this poc hours after the initial disclosure as an exercise, now that they have disclosed it publicly I've put it on public
- Based on the disclosure of Aikido (https://www.aikido.dev/blog/phpbb-authentication-bypass-rce)
includes/ucp/ucp_login_link.phpreads attacker-controlledauth_providerfrom GET and callsprovider_collection->get_provider($request->variable('auth_provider', '')).base::login_link_has_necessary_data()returnsnullin the vulnerable tree, so non-OAuth providers pass the login-link gate.apache::login()requires:- non-empty submitted form password,
PHP_AUTH_USERpresent,PHP_AUTH_USER === login_username,- an existing phpBB row where
usernameequals that value.
apache::login()does not verify the phpBB password and returnsLOGIN_SUCCESSwith the target user row.ucp_login_linkthen callssession_create($login_result['user_row']['user_id']).
so what happens is:
ucp.php?mode=login_link -> get_provider($request->variable('auth_provider')='apache') (provider selectable by request) ->
login_link_has_necessary_data() inherits base -> null (permissive, no gate) -> apache::login() trusts the forged Authorization: Basic ->
PHP_AUTH_USER and returns LOGIN_SUCCESS without ever checking the DB password -> session_create(victim_id).
Run it with
python3 poc.py http://localhost:8080