CVE-2023-49316
Phpseclib needs guardrails on large binaryfield integers
In Math/BinaryField.php in phpseclib 3 before 3.0.34, excessively large degrees can lead to a denial of service.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
7.5
In Math/BinaryField.php in phpseclib 3 before 3.0.34, excessively large degrees can lead to a denial of service.
- Record
CVE-2023-49316- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-834
- Updated
- 2026-11-02
CVE List No score
In Math/BinaryField.php in phpseclib 3 before 3.0.34, excessively large degrees can lead to a denial of service.
- Record
CVE-2023-49316- Updated
- 2026-11-02
EUVDEUVD-2023-2993 No score
In Math/BinaryField.php in phpseclib 3 before 3.0.34, excessively large degrees can lead to a denial of service.
- Record
EUVD-2023-2993- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-2f25-pfq3-c7h8
7.5
Phpseclib needs guardrails on large binaryfield integers
Impact
Anyone loading untrusted ASN1 files (eg. X509 certificates, RSA PKCS8 private or public keys, etc)
Patches
https://github.com/phpseclib/phpseclib/commit/964d78101a70305df33f442f5490f0adb3b7e77f
Workarounds
No.
References
https://github.com/phpseclib/phpseclib/commit/964d78101a70305df33f442f5490f0adb3b7e77f https://www.usenix.org/system/files/usenixsecurity25-shi-bing.pdf
- Record
GHSA-2f25-pfq3-c7h8- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-400, CWE-834
- Updated
- 2026-11-02
GitHub AdvisoriesGHSA-jpr7-q523-hx25
7.5
Duplicate Advisory: phpseclib vulnerable to denial of service
Duplicate Advisory
This advisory has been withdrawn because it is a duplicate of GHSA-2f25-pfq3-c7h8. This link is maintained to preserve external references.
Original Description
In Math/BinaryField.php in phpseclib 3 before 3.0.34, excessively large degrees in binary fields can lead to a denial of service.
- Record
GHSA-jpr7-q523-hx25- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-400, CWE-834
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2023-49316
7.5
In Math/BinaryField.php in phpseclib 3 before 3.0.34, excessively large degrees can lead to a denial of service.
- Record
DEBIAN-CVE-2023-49316- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
Show 4 moreShow less
OSVGHSA-2f25-pfq3-c7h8
7.5
Phpseclib needs guardrails on large binaryfield integers
Impact
Anyone loading untrusted ASN1 files (eg. X509 certificates, RSA PKCS8 private or public keys, etc)
Patches
https://github.com/phpseclib/phpseclib/commit/964d78101a70305df33f442f5490f0adb3b7e77f
Workarounds
No.
References
https://github.com/phpseclib/phpseclib/commit/964d78101a70305df33f442f5490f0adb3b7e77f https://www.usenix.org/system/files/usenixsecurity25-shi-bing.pdf
- Record
GHSA-2f25-pfq3-c7h8- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-400, CWE-834
- Updated
- 2026-11-02
OSVGHSA-jpr7-q523-hx25
7.5
Duplicate Advisory: phpseclib vulnerable to denial of service
Duplicate Advisory
This advisory has been withdrawn because it is a duplicate of GHSA-2f25-pfq3-c7h8. This link is maintained to preserve external references.
Original Description
In Math/BinaryField.php in phpseclib 3 before 3.0.34, excessively large degrees in binary fields can lead to a denial of service.
- Record
GHSA-jpr7-q523-hx25- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-400, CWE-834
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2023-49316
7.5
In Math/BinaryField.php in phpseclib 3 before 3.0.34, excessively large degrees can lead to a denial of service.
- Record
UBUNTU-CVE-2023-49316- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSV No score
In Math/BinaryField.php in phpseclib 3 before 3.0.34, excessively large degrees can lead to a denial of service.
- Record
CVE-2023-49316- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
phpseclib/phpseclibPackagist |
3.0.0 up to 3.0.34 | 3.0.34 |
php-phpseclib3Debian:12 |
before 3.0.19-1+deb12u1, plus listed versions 3.0.19-1 |
3.0.19-1+deb12u1 |
php-phpseclib3Debian:13 |
before 3.0.34-1 | 3.0.34-1 |
php-phpseclib3Debian:14 |
before 3.0.34-1 | 3.0.34-1 |
phpseclib/phpseclibPackagist |
3.0.0 up to 3.0.34, plus listed versions 3.0.13.0.103.0.113.0.123.0.13 Show 19 moreShow less3.0.143.0.153.0.163.0.173.0.183.0.193.0.23.0.203.0.213.0.223.0.233.0.33.0.333.0.43.0.53.0.63.0.73.0.83.0.9 |
3.0.34 |
php-phpseclib3Ubuntu:Pro:22.04:LTS |
All versions, plus listed versions 3.0.9-13.0.10-13.0.12-23.0.13-13.0.13-1ubuntu0.1~esm1 |
None known |
php-phpseclib3Ubuntu:24.04:LTS |
All versions, plus listed versions 3.0.21-23.0.33-13.0.34-13.0.35-13.0.37-1 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected | ||
| affected, aliases, references | EUVD | |
| first indexed | GitHub Advisories, OSV | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2023-49316 is a high vulnerability (CVSS 7.5) in Phpseclib, published November 27, 2023. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.78%, the 56th percentile. Fixed in phpseclib/phpseclib 3.0.34.
References
github.com/phpseclib/phpseclib/commit/964d78101a70305df33f442f5490f0adb3b7e77f
github.com/phpseclib/phpseclib/releases/tag/3.0.34
github.com/phpseclib/phpseclib/security/advisories/GHSA-2f25-pfq3-c7h8
nvd.nist.gov/vuln/detail/CVE-2023-49316
github.com/FriendsOfPHP/security-advisories/blob/master/phpseclib/phpseclib/CVE-2023-49316.yaml
github.com/advisories/GHSA-2f25-pfq3-c7h8