CVE-2024-39912
JSON

5.3medium

Enumeration of valid usernames in web-auth/webauthn-lib

Severity
5.3medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.39% (higher than 35% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-875x-g8p7-5w27

Description

web-auth/webauthn-lib is an open source set of PHP libraries and a Symfony bundle to allow developers to integrate that authentication mechanism into their web applications. The ProfileBasedRequestOptionsBuilder method returns allowedCredentials without any credentials if no username was found. When WebAuthn is used as the first or only authentication method, an attacker can enumerate usernames based on the absence of the `allowedCredentials` property in the assertion options response. This allows enumeration of valid or invalid usernames. By knowing which usernames are valid, attackers can focus their efforts on a smaller set of potential targets, increasing the efficiency and likelihood of successful attacks. This issue has been addressed in version 4.9.0 and all users are advised to upgrade. There are no known workarounds for this vulnerability.

Affected

Product or packageVersionsReported by
web-auth webauthn-framework>= 4.5.0, < 4.9.0CVE List
spomky-labs webauthn_framworkfrom 4.5.0 before 4.9.0CVE List
web-auth/webauthn-lib (Packagist)from 4.5.0 before 4.9.0GitHub Advisory Database
web-auth/webauthn-framework (Packagist)from 4.5.0 before 4.9.0GitHub Advisory Database

All scores

GitHub_M5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
GitHub5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N

Classification

CWE-204

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.

What each source says

CVE List

web-auth/webauthn-lib is an open source set of PHP libraries and a Symfony bundle to allow developers to integrate that authentication mechanism into their web applications. The ProfileBasedRequestOptionsBuilder method returns allowedCredentials without any credentials if no username was found. When WebAuthn is used as the first or only authentication method, an attacker can enumerate usernames based on the absence of the `allowedCredentials` property in the assertion options response. This allows enumeration of valid or invalid usernames. By knowing which usernames are valid, attackers can focus their efforts on a smaller set of potential targets, increasing the efficiency and likelihood of successful attacks. This issue has been addressed in version 4.9.0 and all users are advised to upgrade. There are no known workarounds for this vulnerability.

GitHub Advisory Database
Summary

The ProfileBasedRequestOptionsBuilder method returns allowedCredentials without any credentials if no username was found.

Details

When WebAuthn is used as the first or only authentication method, an attacker can enumerate usernames based on the absence of the allowedCredentials property in the assertion options response. This allows enumeration of valid or invalid usernames.

Proposal how to resolve it:
return $this->publicKeyCredentialRequestOptionsFactory->create(
            $this->profile,
            count($allowedCredentials) <= 0 ? self::getRandomCredentials(): $allowedCredentials,
            $optionsRequest->userVerification,
            $extensions
);

private static function getRandomCredentials(): array
{
        $credentialSources = [];
        for ($i = 0; $i <= rand(0,1); $i++) {
            $credentialSources[] = new PublicKeyCredentialSource(
                random_bytes(32),
                "public-key",
                [],
                "basic",
                new EmptyTrustPath(),
                Uuid::v7(),
                random_bytes(77),
                Uuid::v7()->__toString(),
                rand(0, 6000),
                null
            );
        }
        return array_map(
            static fn (PublicKeyCredentialSource $credential): PublicKeyCredentialDescriptor => $credential->getPublicKeyCredentialDescriptor(),
            $credentialSources
        );
}
PoC

curl https://example.com/assertion/options
-H 'content-type: application/json'
--data-raw '{"username":"NotMeRandomUsername123"}'

Impact

By knowing which usernames are valid, attackers can focus their efforts on a smaller set of potential targets, increasing the efficiency and likelihood of successful attacks.

NVD (es)

web-auth/webauthn-lib es un conjunto de librerías PHP de código abierto y un paquete Symfony para permitir a los desarrolladores integrar ese mecanismo de autenticación en sus aplicaciones web. El método ProfileBasedRequestOptionsBuilder devuelve AllowCredentials sin ninguna credencial si no se encontró ningún nombre de usuario. Cuando se utiliza WebAuthn como primer o único método de autenticación, un atacante puede enumerar los nombres de usuario basándose en la ausencia de la propiedad "allowedCredentials" en la respuesta de las opciones de aserción. Esto permite la enumeración de nombres de usuario válidos o no válidos. Al saber qué nombres de usuario son válidos, los atacantes pueden centrar sus esfuerzos en un conjunto más pequeño de objetivos potenciales, aumentando la eficiencia y la probabilidad de ataques exitosos. Este problema se solucionó en la versión 4.9.0 y se recomienda a todos los usuarios que actualicen. No se conocen workarounds para esta vulnerabilidad.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-39912 changed 2024-08-02CVE Terms of Use
GitHub Advisory DatabaseGHSA-875x-g8p7-5w27 changed 2026-09-10CC-BY-4.0
NVDCVE-2024-39912 changed 2026-06-17Public domain