Public Security Advisories
Coordinated vulnerability disclosures from Argus. Findings, impact, and remediation, published in good faith.
The encrypted-memory variants of the SP modular exponentiation ladders select their working value with a conditional copy whose length mask is truncated to 8 bits on 8-bit limb builds. For moduli of 2041 bits or more the working value is copied with the wrong digit count and the exponentiation returns zero, another wrong value, or an error.
The non-blocking TFM exponentiation fp_exptmod_nb selects the operands of its multiply and reduce steps by the current bit of the RSA private exponent in every build, and of its square steps when WC_NO_CACHE_RESISTANT is defined. The code is compiled only with WC_RSA_NONBLOCK.
The constant-time conditional copy in sp_int.c builds its mask at limb width and reuses it for the 16-bit digit count. With 8-bit limbs only the low byte of the count is copied, so modular exponentiation with a modulus of 2041 bits or more returns a wrong result or an error.
In the TFM backend, fp_exptmod sends a base of 2 to _fp_exptmod_base_2 before it selects the timing-resistant ladder. That routine does work that varies with the secret exponent bits, and DH key generation with generator 2 runs it on the private exponent.
The ESP-IDF and Arduino ESP32 platform defaults define WC_NO_CACHE_RESISTANT. With it, the TFM exponentiation ladder _fp_exptmod_ct selects the operands of its multiply and square by the current secret exponent bit, and the variant that keeps operand addresses constant is compiled out.
// No embargoed advisories.