{"id":"CVE-2024-27354","aliases":["CVE-2024-27354","GHSA-2528-jw5q-ww88"],"related":[],"kind":"vulnerability","state":"published","title":"phpseclib: guardrails needed on isPrime and randomPrime","summary":"An issue was discovered in phpseclib 1.x before 1.0.23, 2.x before 2.0.47, and 3.x before 3.0.36. An attacker can construct a malformed certificate containing an extremely large prime to cause a denial of service (CPU consumption for an isPrime primality check). NOTE: this issue was introduced when attempting to fix CVE-2023-27560.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"An issue was discovered in phpseclib 1.x before 1.0.23, 2.x before 2.0.47, and 3.x before 3.0.36. An attacker can construct a malformed certificate containing an extremely large prime to cause a denial of service (CPU consumption for an isPrime primality check). NOTE: this issue was introduced when attempting to fix CVE-2023-27560.","source":"cvelist"},{"lang":"en","text":"### Impact\nAnyone trying to generate a prime and testing the primality of a number.\n\n### Patches\nhttps://github.com/phpseclib/phpseclib/commit/ad5dbdf2129f5e0fb644637770b7f33de8ca8575\n\n### Workarounds\nUsing the GMP extension would probably help, assuming that one has its own guardrails.\n\n### Resources\nhttps://github.com/phpseclib/phpseclib/commit/ad5dbdf2129f5e0fb644637770b7f33de8ca8575\nhttps://www.usenix.org/system/files/conference/usenixsecurity25/sec25cycle1-prepub-599-shi-bing.pdf","format":"markdown","source":"ghsa"},{"lang":"es","text":"Se descubrió un problema en phpseclib 1.x anterior a 1.0.23, 2.x anterior a 2.0.47 y 3.x anterior a 3.0.36. Un atacante puede crear un certificado con formato incorrecto que contenga un valor principal extremadamente grande para provocar una denegación de servicio (consumo de CPU para una verificación de primalidad de isPrime). NOTA: este problema se introdujo al intentar solucionar CVE-2023-27560.","source":"nvd"}],"published":"2024-03-01T00:00:00.000Z","modified":"2026-06-17T07:19:42.953Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","rating":"HIGH"}],"cwes":["CWE-400"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"custom","introduced":"0","fixed":"1.0.23","status":"affected"}],"vendor":"phpseclib","product":"1x","cpe":"cpe:2.3:a:phpseclib:1x:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"0","fixed":"2.0.47","status":"affected"}],"vendor":"phpseclib","product":"2x","cpe":"cpe:2.3:a:phpseclib:2x:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"0","fixed":"3.0.36","status":"affected"}],"vendor":"phpseclib","product":"3x","cpe":"cpe:2.3:a:phpseclib:3x:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0.1.1","status":"affected","fixed":"1.0.23"}],"ecosystem":"Packagist","package":"phpseclib/phpseclib","purl":"pkg:composer/phpseclib/phpseclib","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.0.0","status":"affected","fixed":"2.0.47"}],"ecosystem":"Packagist","package":"phpseclib/phpseclib","purl":"pkg:composer/phpseclib/phpseclib","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"3.0.0","status":"affected","fixed":"3.0.36"}],"ecosystem":"Packagist","package":"phpseclib/phpseclib","purl":"pkg:composer/phpseclib/phpseclib","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"1.0.0","fixed":"1.0.23"},{"status":"affected","introduced":"2.0.0","fixed":"2.0.47"},{"status":"affected","introduced":"3.0.0","fixed":"3.0.36"}],"vendor":"phpseclib","product":"phpseclib","cpe":"cpe:2.3:a:phpseclib:phpseclib:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"10.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/phpseclib/phpseclib/blob/master/phpseclib/Math/PrimeField.php#L49","tags":["product","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://gist.github.com/katzj/ee72f3c2a00590812b2ea3c0c8890e0b","tags":["third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2024/03/msg00002.html","tags":["mailing-list","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2024/03/msg00003.html","tags":["mailing-list","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/phpseclib/phpseclib/security/advisories/GHSA-2528-jw5q-ww88","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-27354","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/phpseclib/phpseclib/commit/2870c8fab3f132d2ed40a66c97a36fe5ab625698","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/phpseclib/phpseclib/commit/ad5dbdf2129f5e0fb644637770b7f33de8ca8575","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/phpseclib/phpseclib/commit/c55b75199ec8d12cec6eadf6da99da4a3712fe56","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/phpseclib/phpseclib/CVE-2024-27354.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/phpseclib/phpseclib","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"mitre","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2024-03-06T15:59:46.617Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-27354","url":"https://www.cve.org/CVERecord?id=CVE-2024-27354","licence":"CVE Terms of Use","modified":"2025-04-22T15:44:47.697Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-2528-jw5q-ww88","url":"https://github.com/advisories/GHSA-2528-jw5q-ww88","licence":"CC-BY-4.0","modified":"2026-05-06T18:11:13.420Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-27354","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-27354","licence":"Public domain","modified":"2026-06-17T07:19:42.953Z"}],"updatedAt":"2026-11-25T22:58:37.225Z","epss":{"score":0.00601,"percentile":0.50137,"date":"2026-12-01T12:00:22.000Z"}}