
PoC and differential lab for CVE-2026-130347: phpMyFAQ password-reset flow issues tokens for OIDC/LDAP accounts, enabling local password set and IdP/MFA bypass.
| CVE | CVE-2026-130347 (GHSA-59x6-g992-q3fm) |
| Component | phpMyFAQ — Controller/Frontend/UnauthorizedUserController.php::updatePassword() (4.1) |
| Affected | phpMyFAQ before 4.1.12; 4.2.0-alpha before 4.2.0-RC.2 |
| Fixed in | 4.1.12 (the genuine vendor fix — this lab's fixed side) |
| CWE | CWE-640 (Weak Password Recovery Mechanism for Forgotten Password), CWE-287 (Improper Authentication) |
| Impact | Anyone who can trigger a password reset for an externally-provisioned account — and read the reset mail (mailbox access, catch-all, DNS/mail redirection) — sets a NEW LOCAL PASSWORD on that account and logs in with username/password, skipping the IdP entirely and defeating its MFA, conditional access and deprovisioning |
| Vector | Network, unauthenticated — PUT /api/user/password/update + POST /api/user/password/reset (both public routes) |
| Trigger | one reset request naming the victim's login + on-file e-mail, then consume the signed link from the delivered mail |
When phpMyFAQ auto-provisions an account from an external identity provider
(OIDC, Keycloak, Entra ID, LDAP, SSO, WebAuthn), it stores
auth_source='oidc' (etc.) — and creates a random local bcrypt hash in
faquserlogin (a provisioning artifact: User::createUser($login, '')
replaces the empty password with createPassword()). The public reset flow
never inspects auth_source:
// UnauthorizedUserController::updatePassword() (4.1.x, ~L96)
$passHash = $this->getUserPasswordHash($user->getLogin());
if ($passHash === null) {
return $genericSuccess;
}
$expires = time() + self::RESET_TOKEN_TTL;
$signature = $this->signResetToken($user->getUserId(), $expires, $passHash);
// … the signed link is emailed to the on-file address
The token is HMAC-SHA256 over userId|expires|passHash keyed with
main.phpMyFAQToken; possession of the mailed link is the only gate. On
4.1.12 the vendor added an isLocalAccount() gate (auth_source empty or
database) and refuses to issue a token for external accounts. This
laboratory runs the real phpMyFAQ 4.1.11 vs 4.1.12 with Mailpit
catching the reset mail and seeds alice exactly as IdP provisioning
leaves an account behind.
updatePassword() answers a reset request with a generic success in every
negative branch — which is correct anti-enumeration — but its positive
branch has no auth_source check. Because provisioning leaves a random
local hash behind, getUserPasswordHash() returns a real bcrypt hash for
OIDC/LDAP/WebAuthn accounts and the flow proceeds end to end:
request → signed mail → resetPassword() sets a new local password → the
account now authenticates locally with Auth against faquserlogin.pass.
The IdP — and every control attached to it — is out of the picture.
The fixed 4.1.12 controller adds:
// 4.1.12, UnauthorizedUserController (~L207 comment + isLocalAccount())
// "Letting the public reset flow overwrite it would hand out a local
// password that skips the provider's MFA, conditional access and
// deprovisioning (CWE-640)."
if (!$this->isLocalAccount($user)) {
return $genericSuccess;
}
| service | image | role |
|---|---|---|
pmf347-vuln | cve-2026-130347:vuln | phpMyFAQ 4.1.11 (upstream tag) + MariaDB |
pmf347-fixed | cve-2026-130347:fixed | phpMyFAQ 4.1.12 — the vendor fix |
pmf347-db-vuln / pmf347-db-fixed | mariadb:10.11 | per-side databases |
mailpit347-vuln / mailpit347-fixed | axllent/mailpit | per-side SMTP sink (the attacker's mailbox view) |
poc | cve-2026-130347-poc:local | stdlib-only Python driver |
Both app sides get the identical lab additions: alice provisioned as
auth_source='oidc' with an on-file e-mail and a random local hash (what
IdP auto-provisioning leaves), SMTP pointed at the side's Mailpit, and a
lab-only check-user.php status endpoint. Install is driven through the
product's own setup controller. The PoC reads the delivered mail from the
Mailpit HTTP API (GET /api/v1/message/latest) — modelling the
attacker-with-mailbox-access premise deterministically.
./run-lab.sh build # composer install at tags 4.1.11 / 4.1.12
./run-lab.sh up # cve130347lab network: two app+db+mailpit stacks
./run-lab.sh sweep # check / exploit / probe / mitigation on both sides
./run-lab.sh down
poc/poc.py (stdlib only):
alice, read Mailpit for the signed
link, consume it with a chosen password, then prove local login
(POST /index.php like the login form; authenticated iff the rendered
page carries the logout route). Exit 1 vulnerable, 0 safe, 3 no worker,
2 unreachable.| run | pmf347-vuln (4.1.11) | pmf347-fixed (4.1.12) |
|---|---|---|
check | reset mail delivered → token consumed → local login SUCCESS | no mail issued for the OIDC account |
exploit | full chain to an authenticated session | chain stops at step 1 |
probe | OIDC chain completes; tampered sig 400; weak password 400 | no mail; no link to tamper |
mitigation | vulnerable | fixed |
Captured runs: evidence/check-*-run.txt, evidence/exploit-*-run.txt,
evidence/probe-*-run.txt, evidence/mitigation-*-run.txt,
evidence/versions.txt, evidence/0day-sweep.txt.
cve130347lab network (--cpus 2 --memory 4g or less).The sibling-path matrix is the surface sweep (evidence/0day-sweep.txt):
4.1.12 refuses to issue a token for external accounts, unknown users get
no mail, wrong-e-mail stays generic (no enumeration oracle), and the
signature HMAC plus the password policy hold. On 4.1.11 the only broken
invariant is the missing auth_source check. No second bypass form was
found. Deployment note: faquserlogin.pass on external accounts is a
silent local-credential artifact — rotating it or nulling it at
provisioning removes the reset attack surface entirely even on unpatched
releases (the reset flow returns the generic no-mail branch when the hash
is absent).
README.md this write-up
run-lab.sh environment driver (build / up / sweep / down)
Makefile convenience targets
poc/poc.py the PoC (check / exploit / probe / mitigation)
poc/Dockerfile runner image (python:3.12-alpine)
lab/lab.Dockerfile multi-stage build (phpMyFAQ 4.1.11 / 4.1.12)
lab/entrypoint.sh db wait -> setup-controller install -> seed -> smtp -> apache
lab/seed-victim.php provisions the OIDC victim exactly as IdP auto-provisioning
lab/mail-config.php points the mailer at the side's Mailpit
lab/lab-config.php base lab configuration applied identically to both sides
lab/check-user.php lab-only status verification endpoint
evidence/ captured runs of every mode on both sides
TRACKING.md excluded (working record)