CVE-2024-39912: Web auth/webauthn lib The FIDO2/Webauthn Support For PHP Vulnerability
MODERATECVE-2024-39912 is a MODERATE (CVSS 5.3) the fido2/webauthn support for php vulnerability (CWE-204: Observable Response Discrepancy) affecting Web auth/webauthn lib libraries in the Packagist ecosystem. The issue involves the fido2/webauthn support for php library allows enumeration of valid usernames. Remediation is available by upgrading affected packages to version 4.9.0.
CVE-2024-39912 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N).
How to Fix CVE-2024-39912
To remediate this vulnerability, upgrade all affected Web auth/webauthn lib dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade web-auth/webauthn-lib to 4.9.0
Upgrade web-auth/webauthn-framework to 4.9.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for web-auth/webauthn-lib
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-39912, inspect your project dependencies for Web auth/webauthn lib:
inspect dependencies for web-auth/webauthn-lib
Analyze the terminal output to locate any version of Web auth/webauthn lib in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.9.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-204: Observable Response Discrepancy, where the product provides different responses to incoming requests in a way that reveals internal state information to an unauthorized actor outside of the intended control sphere. In Web auth/webauthn lib, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-39912 Affected Web auth/webauthn lib Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
web-auth/webauthn-lib
|
Packagist |
≥ 4.5.0
< 4.9.0
|
4.9.0
|
|
web-auth/webauthn-framework
|
Packagist |
≥ 4.5.0
< 4.9.0
|
4.9.0
|
References
Frequently Asked Questions
What is CVE-2024-39912?
Which Web auth/webauthn lib versions are affected?
What version fixes CVE-2024-39912?
Is web-auth/webauthn-lib affected?
Is web-auth/webauthn-framework affected?
What is the CVSS score of CVE-2024-39912?
What CWE is associated with CVE-2024-39912?
How can I check Packagist dependencies for CVE-2024-39912?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-875x-g8p7-5w27",
"modified" : "2024-07-15T21:38:21Z",
"published" : "2024-07-15T16:37:49Z",
"aliases" : [ "CVE-2024-39912" ],
"summary" : "The FIDO2/Webauthn Support for PHP library allows enumeration of valid usernames ",
"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",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "web-auth/webauthn-lib"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.5.0"
}, {
"fixed" : "4.9.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "web-auth/webauthn-framework"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.5.0"
}, {
"fixed" : "4.9.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"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" : "WEB",
"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"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-204" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-07-15T16:37:49Z",
"nvd_published_at" : "2024-07-15T20:15:03Z"
}
}