wolfSSL — Raw Silicon Labs SE TRNG Output Returned Without DRBG or Health Tests
In builds for the Silicon Labs secure-element TRNG, wc_RNG_GenerateBlock returns the output of silabs_GenerateRand directly and never uses the Hash_DRBG. The wrapper only forwards the buffer to the secure element, so no health test or repeating-output check is applied to any random value the library hands out.
- Advisory
- BYTERAY-2026-0532
- CWE
- CWE-1213
- CVSS
- 2.5 (CVSS:3.1/AV:L/AC:H/PR:L/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 both WOLFSSL_SILABS_SE_ACCEL and WOLFSSL_SILABS_TRNG
- Credit
- Mehrun P. Hunter and Shahriyar Jalayeri, ByteRay Ltd.
Executive Summary
In builds configured for the Silicon Labs secure-element TRNG (WOLFSSL_SILABS_SE_ACCEL with WOLFSSL_SILABS_TRNG), wc_RNG_GenerateBlock() returns early with the result of silabs_GenerateRand(). The Hash_DRBG that the build carries is not used on this path.
silabs_GenerateRand() forwards the caller's buffer to the secure element and maps errors. It does no health testing, no repeating-output detection and no conditioning. Every random value in the process is therefore the secure element's output as delivered: TLS randoms, session-ticket IVs, ECDHE key shares, ECDSA nonces and EC private keys.
If the secure element degraded or began repeating values while still reporting success, nothing in wolfSSL would detect it. This is a missing layer of defense. The secure element conditions its output internally according to vendor documentation, and the failure case is a hardware defect. Default builds do not use this configuration.
Affected Products and Versions
- Component:
wolfcrypt/src/random.c,wc_RNG_GenerateBlock(), andwolfcrypt/src/port/silabs/silabs_random.c,silabs_GenerateRand(). - Required build:
WOLFSSL_SILABS_SE_ACCELandWOLFSSL_SILABS_TRNG, on Silicon Labs parts with a secure element. - Tested: wolfSSL master d95483fff72d6e987394b72edca433d4b580a0f4 (version string 5.9.2).
- A default build does not define these options and is not affected.
- Other releases were not checked.
Technical Details
The early return is at wolfcrypt/src/random.c:5640-5642, before the lock is taken and before the DRBG code further down in the function:
#if defined(WOLFSSL_SILABS_SE_ACCEL) && defined(WOLFSSL_SILABS_TRNG)
return silabs_GenerateRand(output, sz);
#endif
- A consumer calls
wc_RNG_GenerateBlock(). - The function returns
silabs_GenerateRand(output, sz).RngAutoLockEnter()and the Hash_DRBG generation code that starts atwolfcrypt/src/random.c:5676are not reached. silabs_GenerateRand()checks the output pointer, initializes the secure element, callssl_se_get_random()and maps any failure status toWC_HW_E(wolfcrypt/src/port/silabs/silabs_random.c:37-50).- The bytes go to the caller as they came from the secure element.
The same file shows the kind of check that is absent. The RDSEED seeding path has a first-use repeating-value test that latches the source as failed and returns WC_HW_E (wolfcrypt/src/random.c:7105-7147). The Silicon Labs path has no equivalent, and it also bypasses the DRBG, which would otherwise sit between the hardware source and the consumers.
Reachability and Preconditions
- Build:
WOLFSSL_SILABS_SE_ACCELandWOLFSSL_SILABS_TRNG. Off by default. - Every caller of
wc_RNG_GenerateBlock()on such a build takes this path. No runtime setting changes it. - Harm requires the secure element to return repeated or degraded output while reporting success. An attacker cannot cause that remotely, and no field failure of this kind is documented for these parts.
- No authentication or network position is relevant.
Impact
On affected builds the quality of all keys and nonces depends on the secure element alone, with no monitoring in wolfSSL. A silent hardware fault would reach every consumer of the RNG with no error, no log and no fallback to the DRBG. This is a hardening gap and not a directly exploitable flaw.
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 use the secure element as the entropy source that instantiates and reseeds the Hash_DRBG, and to serve consumers from the DRBG. If raw hardware output has to be served directly, silabs_GenerateRand() should apply repetition and proportion health tests and a repeating-output latch like the one on the RDSEED path. The early return should also sit under the same lock handling as the other generation paths, and health-test failures should be logged or counted so that degradation is visible.
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.