Back to Blog
Cryptography & PKI

Short-Sleeve RSA: How Zero-Block Prime Structure Exposed 603 Private Keys in the Wild

Trail of Bits and the badkeys project have uncovered a new class of factorable RSA key — one defined by evenly spaced zero-bit blocks in its prime factors — and found hundreds already deployed in real TLS, SSH, and PGP infrastructure.

PyramidLedger Research4 min read
Share

Key Takeaways

  • Trail of Bits and the badkeys project found 603 RSA and 74 DSA private keys in real-world deployments whose prime factors contain regularly spaced zero-bit blocks — enough internal structure to factor them with polynomial techniques.
  • CompleteFTP versions 10.0.0–12.0.0 (RSA) and 10.0.0–23.0.4 (DSA) generated vulnerable SSH host keys; a significant fraction of installations remain unpatched as of June 2026.
  • Upgrade CompleteFTP to v26.1.0 and run the badkeys tool against all key stores — any matching key should be treated as compromised and rotated immediately.
  • The defect appeared in at least two unrelated product families, suggesting further affected libraries or appliances may not yet have been identified.

A joint research effort by Trail of Bits and the badkeys project has characterised a previously unnamed class of weak RSA key: moduli whose prime factors contain large, regularly spaced blocks of unset bits. Dubbed short-sleeve keys for the visual pattern those zero-blocks create, 603 unique RSA private keys and 74 DSA keys carrying this defect were recovered from Certificate Transparency logs, internet-wide TLS and SSH scans, and PGP keyservers — all without access to the corresponding private key material.

Why These Keys Factor

Standard RSA security rests on the assumption that factoring a large modulus N = p × q is computationally infeasible. Short-sleeve keys violate a subtler assumption: that p and q carry no exploitable internal structure. When the prime factors contain evenly spaced zero-bit blocks, the modulus can be expressed as a polynomial with unusually small coefficients in a base-2^w representation. Factoring that polynomial — using lattice-based techniques in the spirit of Coppersmith's method — is dramatically cheaper than general-purpose integer factorisation and yields the primes directly. The practical result: an RSA private key is recoverable from its public modulus alone.

What the Scans Revealed

Searching the badkeys dataset — aggregated from CT logs, internet-wide TLS and SSH scans, and PGP dumps — the researchers isolated two distinct zero-block patterns in deployed keys:

  • Pattern 1: Appeared in TLS certificates issued to Yahoo and Verizon domains, and in NetApp appliance certificates. All certificates from this pattern have since expired, closing the TLS impersonation window.
  • Pattern 2: Found on live SSH hosts running CompleteFTP software — RSA host keys generated by versions 10.0.0–12.0.0 (December 2016 – March 2019), and DSA host keys generated by versions 10.0.0–23.0.4 (December 2016 – December 2023).
  • A further 26 RSA keys matched a third, as-yet-unidentified pattern, suggesting additional affected codebases remain undiscovered.

While the number of vulnerable CompleteFTP installations has declined over time, the researchers confirmed that a significant fraction still serve SSH connections with broken host keys as of publication. Any live SSH host presenting such a key is exposed to a practical private-key recovery attack.

Remediation Steps

CompleteFTP released version 26.1.0 on 8 May 2026, adding automated detection of vulnerable keys at startup and forcing key regeneration. Enterprisedt also published a standalone KeyChecker tool for administrators who cannot immediately upgrade. For everyone else:

  • Run the open-source badkeys CLI or use the web interface at badkeys.info against your full key inventory — TLS, SSH host keys, and PGP.
  • CompleteFTP administrators: upgrade to v26.1.0 or later immediately and regenerate all RSA and DSA host keys.
  • Do not limit the audit to currently active keys — keys generated in the 2016–2023 window may have been reused or archived; treat any match as a confirmed private-key compromise.
  • If a key matches, rotate and revoke; do not rely on the assumption that the key was never targeted.

Wider Implications for PKI Hygiene

This research demonstrates that key-generation flaws do not require a broken PRNG to produce factorable output — subtle structural bias in prime selection is sufficient. The pattern surfaced independently in at least two unrelated codebases, which is a meaningful signal that the same flaw may exist in other cryptographic libraries, embedded TLS stacks, or network appliances that have not yet been audited. Defenders running automated PKI or SSH hygiene checks should add sparse-modulus detection to their existing controls — alongside checks for short key lengths and known-bad public exponents — rather than treating key length alone as a proxy for strength.

Frequently Asked Questions

What makes a short-sleeve RSA key weak?

The prime factors (p and q) contain large, regularly spaced blocks of unset bits. This sparse structure lets an attacker represent the RSA modulus as a polynomial with small coefficients and factor it using lattice-based techniques, recovering the private key directly from the public modulus — no brute-force required.

Are active TLS certificates affected?

The TLS certificates linked to Pattern 1 (Yahoo, Verizon, NetApp) have all expired and carry no current impersonation risk. If you generated TLS certificates using CompleteFTP in the 2016–2019 window, check them via badkeys.info; any certificate still active should be revoked and reissued immediately.

How do I check whether my keys are vulnerable?

Upload your public keys to badkeys.info or run the open-source CLI tool (github.com/badkeys/badkeys) against your full key inventory including SSH host keys, TLS certificates, and PGP keys. CompleteFTP administrators should upgrade to v26.1.0, which performs the check automatically on startup, and regenerate all host keys.

Sources

  1. 1Factoring RSA Keys with Many ZerosSchneier on Security
  2. 2Factoring Short-Sleeve RSA Keys with PolynomialsTrail of Bits Blog
  3. 3badkeys — check public keys for known vulnerabilitiesbadkeys.info
Share

Read next