PatchClock

PHP security digest · 20 Nov 2026

Poweradmin: The email second factor is an mt_rand() six-digit code verified with no attempt limit or lockout, so an attacker holding the password can brute-force it within the validity window

High CVE-2026-115463

Package
poweradmin/poweradmin
Fixed in
4.2.6, 4.3.5, 4.4.1
Published
Fri 20 Nov 2026, 14:52 LisbonUpdated Tue 24 Nov 2026, 00:45 Lisbon
Installs on Packagist
677

In plain words

An attacker who already knows an account's password can bypass the email second factor by repeatedly guessing its six-digit code. There is no attempt limit or lockout, but the attacker needs sustained requests within the code's ten-minute lifetime. This affects accounts using email MFA; MFA is off by default.

Affected versions

PackageAffectedFixed in
poweradmin/poweradmin>= 4.0.0, < 4.2.64.2.6
poweradmin/poweradmin>= 4.3.0, < 4.3.54.3.5
poweradmin/poweradmin>= 4.4.0, < 4.4.14.4.1

How serious is it?

High is a CVSS score of 7.0 to 8.9: serious impact with few preconditions. Plan the update within days, ahead of feature work, and check the logs for signs it was tried.

poweradmin/poweradmin has 677 installs on Packagist, so the advisory reaches a modest number of projects, which does not make yours any safer.

Am I affected?

Check composer.lock for poweradmin/poweradmin with version >= 4.0.0, < 4.2.6, >= 4.3.0, < 4.3.5 or >= 4.4.0, < 4.4.1. Then check whether MFA is enabled and accounts use the email second factor. Fixed versions are 4.2.6, 4.3.5 and 4.4.1.

Did you install poweradmin/poweradmin, or did a dependency?

Composer says why a package is in your project:

composer why poweradmin/poweradmin

If the output names your own project, you required poweradmin/poweradmin directly and the update is yours to make. If it names another package, poweradmin/poweradmin came in through it, and that package's version constraint decides which release you can install. To see what stands between you and the fix, ask Composer directly:

composer why-not poweradmin/poweradmin 4.2.6

Every line it prints is a constraint that blocks 4.2.6. Update the package it names, or raise your own constraint, and run it again until it prints nothing. If you stay on an older branch, ask about its fix instead: 4.3.5, 4.4.1.

What to do

Check which version you have, then update to a fixed release for your branch (4.2.6, 4.3.5, 4.4.1):

composer show poweradmin/poweradmin | grep versions
composer update poweradmin/poweradmin

If your version constraint in composer.json keeps you below a fixed release, raise it first. Whether your configuration is affected, and the exact version ranges, are in the advisory itself.

If you cannot update yet

The description recommends a failed-attempt counter tied to the user and pending MFA session, invalidating the code and requiring a fresh one after a small number of wrong guesses, plus per-account and per-IP rate limits on the verification endpoint. It also recommends generating codes with random_int() instead of mt_rand() as hardening.

Check the whole project at once

Composer 2.4 and later can list every installed package with a known advisory, this one included once Packagist has it:

composer audit --locked

--locked reads composer.lock instead of the vendor folder, so you can run it on a release tag or in CI without installing anything. It exits with a non-zero code when it finds an advisory, which is enough to fail a build. Run it on every branch you still support, not only the newest: an older release your customers run is affected in the same way.

Under the Cyber Resilience Act

CRA Article 14 timeline: aware of exploitation at hour 0, early warning within 24 hours, notification within 72 hours, final report within 14 days after the fix.

No exploitation of this vulnerability is known, so on its own it does not start the Article 14 reporting clock, which covers actively exploited vulnerabilities. That changes if you learn it is being exploited through your product: then the 24-hour early warning applies.

Either way, if poweradmin/poweradmin ships inside a product you sell, the CRA treats its vulnerabilities as yours. Article 13(5) asks for due diligence on the components you include, and from 11 December 2027 Annex I asks you to ship security fixes without delay and free of charge for the support period you declared. A short note in your changelog saying which release updated poweradmin/poweradmin, and why, is the evidence you will want later.

What goes in each Article 14 report · Does the CRA apply to your product?

poweradmin/poweradmin's record

This is the only advisory for poweradmin/poweradmin since the digest started following Composer packages in September 2026. One advisory says little about a package's quality; what matters is how fast the fix came, and here it is out.

The advisory's description

Summary

The email second factor is an mt_rand() six-digit code verified with no attempt limit or lockout

The email second factor is a six-digit code drawn from mt_rand() and verified with no attempt limit, so an attacker who already has the password can brute-force it inside its validity window.

lib/Domain/Service/MfaService.php, in generateEmailVerificationCode():

$numericCode = mt_rand(100000, 999999);

That is a 900,000-value space, and mt_rand() is a Mersenne Twister rather than a CSPRNG, so it is not appropriate for a security token in the first place. PHP provides random_int() for exactly this.

The bigger problem is that nothing limits guesses. lib/Application/Controller/MfaVerifyController.php calls:

$isValid = $this->mfaService->verifyCode($userId, $code);

and on failure the only action taken is:

$this->logger->warning('[MfaVerifyController] Verification failed for user ID: {user_id}', ['user_id' => $userId]);

I grepped that controller for any counter, lockout, throttle or rate limit and found nothing beyond log statements. So an attacker holding valid credentials submits codes until one lands. Against 900,000 values with no ceiling on attempts, the only thing standing in the way is the code's validity window and however fast requests can be issued.

That defeats the purpose of the second factor: it is meant to hold even when the password is known, and here it reduces to a race the attacker is likely to win with sustained requests.

Two separate fixes, and I would treat the second as the urgent one:

  1. Generate the code with random_int(100000, 999999) so it is not predictable from RNG state.
  2. Enforce a failed-attempt counter tied to the user and the pending MFA session, invalidating the code and requiring a fresh one after a small number of wrong guesses, plus a per-account and per-IP rate limit on the verify endpoint.

Scope: source-verified at master. I confirmed the generator, the verify call site, the log-only failure handling and the absence of any throttling construct in that controller. I did not stand up a Poweradmin instance and run a brute-force against a live code, so the rate at which the space can be covered in practice is not something I measured. If throttling is applied at a layer I did not look at, such as a web-server or reverse-proxy rule shipped with your deployment docs, then the second half of this weakens considerably and I would want to know that.

I used AI assistance while reading the code and preparing this report.


Confirmed, and thanks for the detail. I've widened the affected range: this reaches back to 4.0.0, where MFA was first added, and 4.4.0 still ships it, so the original <= 4.3.4 was too narrow. The 3.x line has no MFA at all and is unaffected. Fixes are in for 4.2.x, 4.3.x, 4.4.x and the development branch.

To answer your question about other layers, there is nothing. No middleware runs in front of that controller, so what you found missing in the controller is the whole picture.

I've adjusted the score down from 9.1 to 7.4. Walking 900,000 values inside the code's ten minute life needs sustained request rates, and MFA is off by default, so there are real preconditions beyond knowing the password. It is still a second factor that does not hold, which is the point of the report.

The mt_rand swap is in as well, though I would treat that as hardening rather than the bug. Recovering the generator state from these codes is not practical in this setup. The missing attempt limit was the actual problem.

Weakness: CWE-307 Improper Restriction of Excessive Authentication Attempts; CWE-338 Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG). Reported by arpitjain099, Sultan0f1, v4nsh0x.

The advisory

From OSV.dev, which gathers the GitHub Advisory Database, FriendsOfPHP and Drupal security advisories; the summary is theirs. The description, affected versions, weakness and credits are from the GitHub Advisory Database (CC BY 4.0). "In plain words", "Am I affected?" and "If you cannot update yet" are based on that advisory, and checked to name no version it does not.