{"id":"CVE-2024-39912","aliases":["GHSA-875x-g8p7-5w27"],"url":"https://o3.security/vulnerability/CVE-2024-39912","summary":"Enumeration of valid usernames in web-auth/webauthn-lib","details":"### Summary\n\nThe ProfileBasedRequestOptionsBuilder method returns allowedCredentials without any credentials if no username was found.\n\n### Details\n\nWhen 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.\n\n#### Proposal how to resolve it:\n \n```\nreturn $this->publicKeyCredentialRequestOptionsFactory->create(\n            $this->profile,\n            count($allowedCredentials) <= 0 ? self::getRandomCredentials(): $allowedCredentials,\n            $optionsRequest->userVerification,\n            $extensions\n);\n\nprivate static function getRandomCredentials(): array\n{\n        $credentialSources = [];\n        for ($i = 0; $i <= rand(0,1); $i++) {\n            $credentialSources[] = new PublicKeyCredentialSource(\n                random_bytes(32),\n                \"public-key\",\n                [],\n                \"basic\",\n                new EmptyTrustPath(),\n                Uuid::v7(),\n                random_bytes(77),\n                Uuid::v7()->__toString(),\n                rand(0, 6000),\n                null\n            );\n        }\n        return array_map(\n            static fn (PublicKeyCredentialSource $credential): PublicKeyCredentialDescriptor => $credential->getPublicKeyCredentialDescriptor(),\n            $credentialSources\n        );\n}\n```\n\n### PoC\n\ncurl https://example.com/assertion/options \\\n  -H 'content-type: application/json' \\\n  --data-raw '{\"username\":\"NotMeRandomUsername123\"}'\n\n### Impact\n\nBy 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.\n","published":"2024-07-15T19:38:04.824Z","modified":"2026-08-12T03:51:28.422195641Z","cvss":{"score":5.3,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"},"epss":{"score":0.00394,"percentile":0.33257,"asOf":"2026-09-17"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Packagist","name":"web-auth/webauthn-lib","fixedVersion":"4.9.0"},{"ecosystem":"Packagist","name":"web-auth/webauthn-framework","fixedVersion":"4.9.0"}],"fix":{"url":"https://github.com/web-auth/webauthn-framework/commit/64de11f6cddc71e56c76e0cc4573bf94d02be045","label":"web-auth/webauthn-framework@64de11f"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/39xxx/CVE-2024-39912.json"},{"type":"ADVISORY","url":"https://github.com/web-auth/webauthn-framework/security/advisories/GHSA-875x-g8p7-5w27"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-39912"},{"type":"FIX","url":"https://github.com/web-auth/webauthn-framework/commit/64de11f6cddc71e56c76e0cc4573bf94d02be045"},{"type":"WEB","url":"https://github.com/web-auth/webauthn-framework/commit/a9d1352897fba552e659e1445a771dec2d4ed05a"},{"type":"WEB","url":"https://github.com/web-auth/webauthn-lib/commit/b6798de27cdedd8681fe4c9b13ace0ff2456d18b"},{"type":"PACKAGE","url":"https://github.com/web-auth/webauthn-framework"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:28.422195641Z"}}