CVE-2024-27354
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedAn 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.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceA malformed certificate containing an extremely large prime triggers a computationally expensive isPrime() primality check in phpseclib 1.x < 1.0.23, 2.x < 2.0.47, and 3.x < 3.0.36, leading to CPU exhaustion and denial of service. This is a regression introduced while attempting to fix CVE-2023-27560.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.
NVD · CPE data= 10.0>= 1.0.0, < 1.0.23>= 2.0.0, < 2.0.47>= 3.0.0, < 3.0.36CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Find the installed phpseclib versionInspect your composer.json file for the phpseclib version entry, or check vendor/composer/installed.json for the installed version. Alternatively, run 'composer show phpseclib/phpseclib' in your project directory.Affected if The version is below 1.0.23 for 1.x, below 2.0.47 for 2.x, or below 3.0.36 for 3.x series.
-
Confirm the phpseclib major versionLook at the first digit of the version number in the same location as step 1 to determine if you are using the 1.x, 2.x, or 3.x branch.Affected if You are using any version less than the corresponding cutoff for your major version branch.
-
Identify if certificate processing is in useSearch your codebase for phpseclib class usage, particularly BigInteger, RSA, or X509 classes. Check for code that loads, parses, or validates certificates using phpseclib functions.Affected if Your application processes X.509 certificates or other cryptographic certificate data using phpseclib, and the vulnerable version is in use.
-
Check for direct BigInteger primality checksSearch your codebase for calls to isPrime() or similar primality testing methods on BigInteger objects, especially when handling certificate-derived values.Affected if Your code explicitly calls isPrime() on certificate data, and the phpseclib version is vulnerable.
You are affected if your installed phpseclib version falls within any of the vulnerable ranges and your application processes certificates using the affected library code.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scoped1.0.232.0.473.0.36
Update phpseclib to version 1.0.23, 2.0.47, or 3.0.36 or later to patch the vulnerability. If immediate updating is not possible, consider rate-limiting or restricting certificate input processing as a temporary workaround.
phpseclib 1.0.23 (1.x series), 2.0.47 (2.x series), or 3.0.36 (3.x series)
- Identify which major version of phpseclib (1.x, 2.x, or 3.x) is in use by examining the project's composer.json or vendor directory
- Run 'composer require phpseclib/phpseclib:3.0.36' (for 3.x) or 'phpseclib/phpseclib:2.0.47' (for 2.x) or 'phpseclib/phpseclib:~1.0.23' (for 1.x) to update the dependency
- Run 'composer update phpseclib/phpseclib' to install the updated version
- Verify the installation succeeded by checking the installed version with 'composer show phpseclib/phpseclib'
- Regenerate any certificates or keys that may have been processed by the vulnerable code to ensure clean state
- Test the application to confirm normal functionality after the upgrade
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation2.0 h
- Implementation2.0 h
- Testing3.0 h
- Review / QA2.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $2,512.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2024-27354 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2024-27354 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data