wolfSSL — Missing Scalar Blinding in Curve448 Scalar Multiplication
The X448 Montgomery ladder in wolfCrypt runs on the secret scalar with no blinding, and no build option adds one. An attacker with power or electromagnetic measurement access to a device can attempt to recover the scalar by correlating traces of repeated X448 operations.
- Advisory
- BYTERAY-2026-0540
- CWE
- CWE-1300
- CVSS
- 2.0 (CVSS:3.1/AV:P/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N)
- Vendor
- wolfSSL
- Product
- wolfSSL
- Reported
- 2026-09-28
- Disclosure
- 2026-12-03
- Affected
- wolfSSL 5.9.2 (tested at master commit d95483f), builds with HAVE_CURVE448 using the software X448 implementation
- Credit
- Mehrun P. Hunter and Shahriyar Jalayeri, ByteRay Ltd.
Executive Summary
wolfCrypt computes X448 key agreement and X448 public keys with a Montgomery ladder, curve448(). The ladder runs a fixed number of iterations and uses each secret scalar bit only for a conditional swap, so its control flow does not depend on the scalar.
The ladder is not randomized. There is no scalar blinding for Curve448 anywhere in the tree, and no build option that adds it. The X25519 code in the same library has such an option, WOLFSSL_CURVE25519_BLINDING. Repeated X448 operations on the same scalar therefore produce traces that line up and can be correlated with the scalar bits.
An attacker who can measure a device's power consumption or electromagnetic emissions while triggering X448 handshakes can attempt to reconstruct the scalar. This needs physical access and analysis of many traces of an already constant-time ladder. The code is compiled only when HAVE_CURVE448 is defined.
Affected Products and Versions
- Component:
wolfcrypt/src/fe_448.c,curve448(), called fromwolfcrypt/src/curve448.c. - Required build:
HAVE_CURVE448. Four shipped templates define it:IDE/XilinxSDK/vitis_sdt/lib/sw_services/wolfssl/src/user_settings_template.h:92,IDE/WIN-SRTP-KDF-140-3/user_settings.h:124,IDE/C2000/user_settings.h:84andIDE/XCODE-FIPSv6/user_settings.h:427. - Tested: wolfSSL master d95483fff72d6e987394b72edca433d4b580a0f4 (version string 5.9.2).
- Builds without
HAVE_CURVE448do not compile this path. The ESP-IDF and Arduino templates do not define it. - Other releases were not checked.
Technical Details
Every secret X448 scalar multiplication goes through curve448(), which takes the scalar and the base point and has no randomization input. There are three call sites:
wc_curve448_shared_secret_ex()computes the shared secret withcurve448(o, private_key->k, public_key->p)(wolfcrypt/src/curve448.c:399).curve448_make_pub_ex()derives the public key (wolfcrypt/src/curve448.c:118).wc_curve448_generic()is the generic entry (wolfcrypt/src/curve448.c:220).
The ladder itself (wolfcrypt/src/fe_448.c:348-399) runs 448 iterations. The secret bit drives only fe448_cswap (wolfcrypt/src/fe_448.c:365-369, wolfcrypt/src/fe_448.c:391-392). That removes timing and branch leakage. It does not change the fact that the same scalar and the same point representation are used on every run.
For Curve25519, WOLFSSL_CURVE25519_BLINDING is defined by default for the non-small C build (wolfssl/wolfcrypt/settings.h:4792-4798). Curve448 has no counterpart macro, so the countermeasure is absent and not just switched off.
- A TLS 1.3 peer negotiates the x448 group and sends its key share.
wc_curve448_shared_secret_ex()(wolfcrypt/src/curve448.c:337) is called with the device's private key and the peer's public value.curve448()runs the ladder over the private scalar with no blinding (wolfcrypt/src/curve448.c:399).- The power and electromagnetic signature of each run carries the same scalar-dependent pattern.
Reachability and Preconditions
- Build with
HAVE_CURVE448, using the software implementation. - The device performs X448 key agreement or key generation. A TLS 1.3 peer can trigger key agreement by negotiating x448. No authentication is needed to start a handshake.
- The attacker has physical or near-field access to measure power or electromagnetic emissions during the operation.
- A long-lived X448 key gives the attacker many traces of the same scalar. An ephemeral key share limits each scalar to one handshake.
Impact
Recovery of an X448 private scalar by physical side-channel analysis. For an ephemeral scalar this compromises the keys of the observed session. For a long-lived key it allows impersonation of the device. The ladder is constant-time in structure, so the attack needs physical measurement and trace correlation across many operations. The affected configurations are few, and x448 is rarely negotiated.
ByteRay did not build a proof of concept for this issue. The analysis is from source review.
Remediation and Mitigation
ByteRay has not confirmed a fixed wolfSSL release for this issue as of 2026-12-03, and has not checked it against wolfSSL changes made after the tested commit.
The fix direction is to carry the Curve25519 model over to Curve448: a blinding option that is on by default for the non-small C build, which adds a random multiple of the group order to the scalar before the ladder and re-randomizes the projective representation of the working point on each run, guarded on RNG availability as the Curve25519 path is.
Workarounds for physically exposed devices: leave HAVE_CURVE448 out of the configuration, or prefer the x25519 group in a build where Curve25519 blinding is active.
Timeline
- 2026-09-28 — Reported to wolfSSL.
- 2026-12-03 — Public disclosure.
Credits
Discovered and reported by Mehrun P. Hunter and Shahriyar Jalayeri of ByteRay Ltd.