Raw RSA signing interfaces let attackers forge 1024-bit signatures without the key; DeepMind showed on 6 November 2026 which PKCS#11 mechanisms qualify. Audit and restrict.
Forging signatures without the key
In September 2026, Laura Shea, Miro Haller, Adam Suhl, Nadia Heninger and Emmanuel Thomé published a computation that should change how teams think about signing interfaces (IACR ePrint 2026/2131). Using a hardware security module as a black box, they forged 1024-bit RSA signatures without ever recovering the key. They queried the HSM's raw RSA interface about 2^32 times during a precomputation; afterwards they could sign any message of their choice offline. The whole attack took 1,380 CPU core-years over five calendar months, far less than factoring the modulus, which the later paper estimates at 500,000 to 1,000,000 core-years.
On 6 November 2026 Google DeepMind published a working paper, "Modular Roots from a Restricted Oracle", written with Heninger and Thomé. It reran the same 1024-bit computation with two cooperating AI agents and the same algorithm, polynomials and bounds: the first root took 391 CPU core-years, 3.5 times less, and the agents designed, ran and debugged it in under four days. More useful for engineers, the paper maps the attack onto the PKCS#11 mechanisms that HSMs expose. The paper states: "Our results don't threaten deployed cryptosystems today that are based on 2048-bit and larger RSA."
This guide turns that mapping into an inventory you can run against your own keys. The companion code classifies a synthetic key inventory; nothing in it touches an HSM.
Why a signing interface can be an oracle
Textbook RSA has a multiplicative property: the signature of a product is the product of the signatures. If an interface will compute the RSA private operation on any value you give it, it is a tool for computing roots of values you choose. With a toy modulus of 3,233, the companion code asks such an interface for the "signatures" of 42 and 55, multiplies them, and gets a valid signature for 42 x 55 mod 3,233 without ever asking for it. Real attacks are vastly more involved: they collect roots of many small primes and use number field sieve machinery to express an arbitrary target in terms of them. But the starting point is the same: an interface that applies the private key to inputs you choose.
Padding and hashing exist to remove that freedom. A proper signature scheme hashes the message and formats the result, so the caller cannot choose the number the private key is applied to.
The PKCS#11 interfaces, by how many bytes the caller chooses
The DeepMind paper classifies signing interfaces by how much of the RSA block the caller controls. For a 1024-bit modulus, the block is 128 bytes:
| Interface | Bytes the caller chooses | What the paper says applies |
|---|---|---|
CKM_RSA_X_509, raw RSA | 128 | the unrestricted oracle used by the 1024-bit computations |
CKM_RSA_PKCS with caller data of 65 bytes or more | up to 117 | the format "is no obstacle": the unrestricted algorithm runs with twice as many queries |
CKM_RSA_PKCS with a caller-supplied 64-byte digest (SHA-512) | 64 | at the threshold; a re-randomization step succeeded on about 80 percent of draws |
CKM_RSA_PKCS with a caller-supplied 32-byte digest (SHA-256) | 32 | a harder problem; the paper lowers its asymptotic cost but "did not run it at this size" |
CKM_SHA256_RSA_PKCS and other hash-inside mechanisms | 0 | outside both oracle models |
The threshold is about half the block. The paper's Theorem 4.1 applies once the caller's part is at least half the modulus length plus about two bits, which at 1024 bits is 65 bytes. CKM_RSA_PKCS accepts up to 117 bytes of caller data (the block length minus 11), so the fixed PKCS#1 v1.5 formatting does not protect a key whose callers can send long inputs.
The catch with CKM_RSA_PKCS
CKM_RSA_PKCS is the mechanism most applications use when they hash in software and send the device a DigestInfo structure to sign. The application sends a 51-byte DigestInfo for SHA-256, so it looks like the 32-byte row. But the token does not check that the input is a DigestInfo. Anyone who can call the key directly can send 117 bytes of their choice. Whether a key is in the 32-byte row or the 117-byte row depends on who can reach the PKCS#11 interface, not on what the usual application sends.
That is why the paper lists three conditions that limit the practical reach of its results: the largest size actually attacked is 1024 bits; the model needs direct calls with inputs of the caller's choice, "rather than calls through an application that hashes the message before signing"; and the number of calls is large, about 4 x 10^9 in the 1024-bit computation, all made before the target is known.
An inventory, key by key
The companion audit.py takes one record per key (type, modulus size, whether it can sign, its CKA_ALLOWED_MECHANISMS, and whether callers can reach it directly) and classifies the worst interface it exposes:
def classify_mechanism(mech, modulus_bits, caller_bytes):
n = modulus_bits // 8
if mech == "CKM_RSA_X_509":
return "raw_oracle", n
if mech in HASH_INSIDE: # CKM_SHA256_RSA_PKCS and similar
return "hash_inside", 0
if mech == "CKM_RSA_PKCS":
chosen = min(caller_bytes if caller_bytes is not None else n - 11, n - 11)
if chosen >= threshold_bytes(modulus_bits): # 65 at 1024 bits
return "format_no_obstacle", chosen
return ("digest_at_threshold" if chosen * 8 >= modulus_bits // 2 else "digest_affine"), chosenOn the synthetic inventory of a book store's signing keys:
| Key | Size | Allowed mechanisms | Class |
|---|---|---|---|
| invoice-signing-2019 | 1024 | none set | raw_oracle |
| legacy-token-signer | 1024 | CKM_RSA_PKCS, callers reach it directly | format_no_obstacle |
| catalogue-feed-sha512 | 1024 | CKM_RSA_PKCS, only via an application sending SHA-512 digests | digest_at_threshold |
| order-receipts-sha256 | 1024 | CKM_RSA_PKCS, only via an application sending SHA-256 digests | digest_affine |
| release-signing-2024 | 3072 | CKM_SHA256_RSA_PKCS, CKM_SHA256_RSA_PKCS_PSS | hash_inside |
| partner-api-2023 | 2048 | CKM_RSA_X_509, CKM_SHA256_RSA_PKCS | raw_oracle |
The first row is the most common finding in practice: a key with no CKA_ALLOWED_MECHANISMS list. The PKCS#11 attribute exists to restrict a key to a list of mechanisms; without it, the key can be used with any mechanism the token supports, raw RSA included. The last row is a 2048-bit key: the paper's estimates do not make it forgeable today, but a raw interface on any signing key serves no legitimate purpose that a hash-inside mechanism cannot.
What to change
- Set
CKA_ALLOWED_MECHANISMSon every signing key to the hash-inside mechanisms the application actually uses, such asCKM_SHA256_RSA_PKCSor the PSS variant. - Remove
CKM_RSA_X_509from signing keys. The paper notes that the raw map is not an approved signature scheme. - Close direct access to keys used through
CKM_RSA_PKCS. If an application must hash outside the device, make sure only that application holds the credentials to call the key. - Retire RSA signing keys under 2048 bits. NIST SP 800-131A Rev. 2 (March 2019) does not approve them for generating signatures. The paper's results are about this size.
- Plan the move away from RSA where you can. The earlier paper argues that its results give classical evidence for leaving RSA during the post-quantum transition; that is a longer project, but new keys are the cheapest place to start.
Failure modes
- Reading "2048-bit is safe" as "raw interfaces are fine". The safety statement is about cost at 2048 bits, not about the interface.
- Trusting the application's input format. The token signs whatever arrives.
- Inventorying only certificates. Keys used for internal tokens, licence files and signed feeds often never appear in a certificate inventory.
- Ignoring blind signature schemes. The September paper notes that blind RSA schemes also provide a raw signing oracle by design.
What remains uncertain
The DeepMind paper is a working paper, and its complexity results for the 32-byte case are asymptotic and rest on standard number field sieve heuristics. The 3.5-times saving was measured on one instance with the linear algebra on GPUs not counted in CPU time. The practical cost of attacking a specific HSM also depends on how fast it answers several billion queries and whether anyone notices them, which neither paper measures for production devices.