Feb 15, 2026·5 min read·74 visits
The sm-crypto library failed to strictly enforce canonical ranges for SM2 signatures. Attackers can take an existing valid signature `(r, s)` and generate a new valid signature `(r, s')` by exploiting modular arithmetic (e.g., adding the curve order `n` to `s`). While they cannot forge signatures for *new* messages, they can change the binary representation of existing signatures, breaking systems that rely on unique signature hashes (like transaction IDs).
A signature malleability vulnerability in the popular sm-crypto library allows attackers to mutate valid SM2 signatures into new, mathematically valid signatures without access to the private key. This flaw creates potential integrity issues for applications relying on signature uniqueness, such as blockchain ledgers or deduplication systems.
In the world of cryptography, we generally assume a one-to-one relationship between a specific signature blob and the mathematical proof it represents. If I sign a document, that signature is the digital seal. If you change a single bit of that seal, it should break. That's the theory. In practice, implementation details are where dreams go to die.
sm-crypto is the de facto JavaScript implementation for the Chinese National Standard (Guobiao) cryptographic algorithms: SM2 (ECC), SM3 (Hashing), and SM4 (Block Cipher). It's widely used in financial tech and government-adjacent applications within the Node.js ecosystem.
CVE-2026-23967 is a "Signature Malleability" vulnerability. It sounds academic, almost harmless. "So what if I can change the signature? I can't forge it!" you might say. But in systems where the signature's hash is used as a unique identifier—like blockchain transaction IDs or audit logs—malleability is a nightmare. It allows an attacker to take your valid transaction, clone it into a mathematically identical but binary-distinct "evil twin," and potentially trick the system into processing the wrong one or messing up accounting logic. It's not about stealing the key; it's about gaslighting the database.
To understand this bug, we have to look at how SM2 signatures work. An SM2 signature consists of two integers: (r, s). The verification involves checking if these numbers satisfy a specific elliptic curve equation involving the signer's public key.
The math operates in a finite field modulo n (the order of the curve group). In modular arithmetic, numbers wrap around. Ideally, a signature implementation should force r and s to be in the canonical range [1, n-1].
The vulnerability in sm-crypto stems from a failure to enforce this strict range. It likely allowed non-canonical representations of s. For example, if s is a valid solution, then s + n is often mathematically equivalent in the verification equation because the first step usually involves a modulo operation (s + n) mod n == s.
By accepting s' = s + n (or other non-canonical forms depending on the exact implementation oversight), the library validates the signature. However, the byte representation of s and s' is totally different. The computer sees 0x12... vs 0x99.... If your application hashes these bytes to create a "Transaction ID," you now have two valid IDs for the exact same action. The cryptography works, but the application logic crumbles.
Let's look at what the vulnerable code conceptually does versus what it should do. In elliptic curve libraries, the verify function usually looks something like this:
// Vulnerable Logic (Conceptual)
function verify(msg, signature, publicKey) {
const r = signature.r;
const s = signature.s;
// The missing check:
// We proceed directly to math without checking if s > n
const t = (r + s) % n;
if (t === 0) return false;
const point = G.mul(s).add(publicKey.mul(t));
// ... rest of verification
}The fix introduced in version 0.3.14 is boring but critical. It forces the inputs to be strictly within the group order n. It slams the door on the s + n trick.
// Patched Logic
function verify(msg, signature, publicKey) {
const r = signature.r;
const s = signature.s;
// STRICT RANGE ENFORCEMENT
if (r.cmp(1) < 0 || r.cmp(n) >= 0) return false;
if (s.cmp(1) < 0 || s.cmp(n) >= 0) return false;
const t = (r + s) % n;
// ... rest of verification
}By adding those cmp(n) >= 0 checks, the library ensures that there is only one valid byte representation for every mathematical signature. The "evil twin" is now rejected as invalid input.
How do we weaponize this? Let's assume you are attacking a ledger system that uses sm-crypto. This system creates a TxID by hashing the signed payload.
The Scenario:
m. Her signature is (r, s).TxID is SHA256(m || r || s).s and calculates s' = s + n.m with signature (r, s').The Result:
Both transactions are valid. They spend the same inputs. But they have different hashes (TxID_1 vs TxID_2).
If the network processes Mallory's transaction first, Alice's original transaction is rejected (double spend). However, Alice's wallet is watching for TxID_1. It never confirms. Alice thinks the payment failed. She might resend the payment, paying Bob twice. Meanwhile, the first payment did go through, just under TxID_2.
This is a classic "Transaction Malleability" attack, famously plaguing Bitcoin exchanges like Mt.Gox in the early days (though via DER encoding issues there, the principle is identical).
The remediation is straightforward: upgrade sm-crypto to version 0.3.14 or later. This version introduces the strict range checks required to prevent malleability.
If you cannot upgrade immediately, you must implement the check in your application layer before passing the signature to the library:
const n = new BigInteger('...'); // SM2 curve order
if (signature.s.greaterThanOrEqualTo(n)) {
throw new Error('Signature malleability detected: s value non-canonical');
}This acts as a bouncer at the door, rejecting the bloated s values before the vulnerable library processes them.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
sm-crypto JuneAndGreen | < 0.3.14 | 0.3.14 |
| Attribute | Detail |
|---|---|
| CWE | CWE-347 (Improper Verification of Cryptographic Signature) |
| CVSS | 7.5 (High) |
| Impact | Integrity / Signature Malleability |
| Attack Vector | Network (AV:N) |
| EPSS Score | 0.00008 (Low) |
| Patch Status | Fixed in v0.3.14 |
The software verifies a cryptographic signature but does not verify that the signature is in a unique, canonical format, allowing malleability.
Gradle versions prior to 8.14.4 and 9.3.0 fail to classify certain fatal network transport exceptions, such as UnknownHostException and NoHttpResponseException, as critical failures during dependency resolution. When these exceptions occur and retry thresholds are exhausted, Gradle fails to disable the unreachable primary repository and instead falls through to subsequent repositories configured in the build script. An attacker capable of disrupting connectivity to an upstream repository can force the build tool to fetch malicious artifacts with matching coordinates from a downstream, untrusted repository.
NATS Server prior to versions 2.12.8 and 2.14.3 contains an incorrect authorization vulnerability (CWE-863) in its message tracing subsystem. When evaluating whether a connection is permitted to publish trace events to a destination subject specified in the Nats-Trace-Dest header, the server only checks standard client permissions and omits permission checks for leaf node connections. This allows a connected leaf node operator with restricted publishing privileges to emit internal trace events to unauthorized subjects and suppress standard message delivery using the Nats-Trace-Only header.
CVE-2026-63341 is a high-severity Denial of Service (DoS) vulnerability in the Aedes MQTT broker for Node.js affecting all versions prior to 1.1.1. The flaw stems from missing input validation on the hierarchical depth of incoming MQTT topic strings before they are passed to the underlying topic-matching engine, qlobber. Because qlobber enforces a hardcoded limit of 100 topic levels and throws a synchronous exception when this threshold is exceeded, an attacker can send a single MQTT packet containing 101 or more forward-slash-separated levels to trigger an uncaught exception that immediately terminates the Node.js broker process.
CVE-2026-61725 is a path traversal vulnerability (CWE-22) in the sevenz-rust2 Cargo package prior to version 0.21.1. The vulnerability occurs because the decompression utility fails to validate or sanitize archive entry filenames before joining them with the destination directory path via std::path::Path::join. An attacker who supplies a crafted 7z archive containing parent directory traversal sequences or absolute paths can write or overwrite arbitrary files on the host filesystem with the privileges of the extracting process.
CVE-2026-77309 (GHSA-jrjx-9jjw-747m) is a high-severity unauthenticated remote code execution vulnerability affecting NASA-AMMOS AIT-GUI versions 1.0.0 through 2.5.0. The flaw results from chaining an incomplete file cleanup error in the telemetry query endpoint (/tlm/query) with a directory traversal flaw in the script execution endpoint (/script/run). An attacker on an adjacent network can stage arbitrary Python statements into a static file on disk and execute that file under the privileges of the AIT-GUI web server process.
A vulnerability classified under CWE-116 (Improper Encoding or Escaping of Output) exists in memtomem-stm versions 0.1.0 through 0.1.33. The software acts as a Model Context Protocol (MCP) short-term memory proxy gateway for AI agent architectures. When surfacing retrieved memories and scratchpad items into downstream Large Language Model (LLM) context envelopes, the SurfacingFormatter component fails to properly sanitize untrusted memory attributes. An attacker with the ability to plant untrusted content into the agent's long-term or working memory store can inject arbitrary structural delimiters, close the <surfaced-memories> XML boundary prematurely, visually obscure instructions using Unicode bidirectional overrides, and execute stored prompt injection attacks against downstream LLM agents.