Debian LinuxOperating system · Debian

CVE-2024-27354

HIGH · 7.5 CVSS v3.1 Published 2024-03-01
Fix available
A fix is available. Upgrade to 1.0.23 / 2.0.47 or later.
See remediation →
84/100
Remediation priority · High
Remotely reachable No privileges Zero-click

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 · unedited
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.

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 confidence

A 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.

MitigationUpdate 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.

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
Debian LinuxOperating system
Affected:= 10.0
PhpseclibApplication
Affected:>= 1.0.0, < 1.0.23>= 2.0.0, < 2.0.47>= 3.0.0, < 3.0.36

CVSS 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 checks

Work through these to decide whether this CVE applies to you.

  1. Find the installed phpseclib version
    Inspect 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.
  2. Confirm the phpseclib major version
    Look 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.
  3. Identify if certificate processing is in use
    Search 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.
  4. Check for direct BigInteger primality checks
    Search 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.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

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 · scoped
Upgrade available Upgrade to 1.0.23 / 2.0.47 / 3.0.36 or later
Fixed in 1.0.232.0.473.0.36
Interim mitigation

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.

Recommended fix High confidence

phpseclib 1.0.23 (1.x series), 2.0.47 (2.x series), or 3.0.36 (3.x series)

  1. 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
  2. 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
  3. Run 'composer update phpseclib/phpseclib' to install the updated version
  4. Verify the installation succeeded by checking the installed version with 'composer show phpseclib/phpseclib'
  5. Regenerate any certificates or keys that may have been processed by the vulnerable code to ensure clean state
  6. Test the application to confirm normal functionality after the upgrade
Caveat Review the phpseclib changelog between your current version and the target version for any backward-incompatible changes in your used features

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Debian Linux Scoped from the published advisory
  • Consultation2.0 h
  • Implementation2.0 h
  • Testing3.0 h
  • Review / QA2.0 h
9.0 hours of engineering $1,570
Get the upgrade done

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 locally
dbcve dependency scanner

Check 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 sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2024-27354 in production — separate from our analysis above.

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.

What this is

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.

What belongs here
  • 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