Advisory

GHSA-2528-jw5q-ww88

Also known as: CVE-2024-27354

Summary

phpseclib: guardrails needed on isPrime and randomPrime

Details

Impact
Anyone trying to generate a prime and testing the primality of a number.

Patches
https://github.com/phpseclib/phpseclib/commit/ad5dbdf2129f5e0fb644637770b7f33de8ca8575

Workarounds
Using the GMP extension would probably help, assuming that one has its own guardrails.

Resources
https://github.com/phpseclib/phpseclib/commit/ad5dbdf2129f5e0fb644637770b7f33de8ca8575
https://www.usenix.org/system/files/conference/usenixsecurity25/sec25cycle1-prepub-599-shi-bing.pdf

Severity

High Basis: The source's own band: HIGH

Dates

Published
2026-05-06 17:57 UTC
Modified
2026-05-06 18:11 UTC

Affected packages and fixes

phpseclib/phpseclib

Packagist · All systems

Affected

  • introduced 0.1.1, fixed 1.0.23 (ecosystem)

Fixed versions

1.0.23

Fix

The export has no generic command for this ecosystem.

phpseclib/phpseclib

Packagist · All systems

Affected

  • introduced 2.0.0, fixed 2.0.47 (ecosystem)

Fixed versions

2.0.47

Fix

The export has no generic command for this ecosystem.

phpseclib/phpseclib

Packagist · All systems

Affected

  • introduced 3.0.0, fixed 3.0.36 (ecosystem)

Fixed versions

3.0.36

Fix

The export has no generic command for this ecosystem.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences