CVE-2023-27560 is a high-severity (CVSS 7.5) CWE-835 vulnerability in phpseclib/phpseclib. A fix is available for phpseclib/phpseclib — see the affected versions and patch details below.
phpseclib Infinite Loop vulnerability
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2023-27560.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
phpseclib/phpseclibReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Packagist packages — download data is not available via public APIs for these ecosystems.
Description
Math/PrimeField.php in phpseclib has an infinite loop with composite primefields. This vulnerability was introduced in version 3.0.0, and has been patched in 3.0.19. The CVE for this issue originally identified the the vulnerable version as 2.x, however, the vulnerable functionality was not introduced until version 3.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐘Packagist | phpseclib/phpseclib | ≥ 3.0.0&&< 3.0.19 | 3.0.19composer require phpseclib/phpseclib:^3.0.19 |
Affected Products
phpseclibphpseclibDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for phpseclib/phpseclib, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update phpseclib/phpseclib to 3.0.19 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2023-27560 is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Frequently Asked Questions
Is CVE-2023-27560 in your dependencies?
Find it across Packagist, including transitive dependencies.