wolfSSL — Unvetted Vendor PRNG UTL_Rand as Sole DRBG Seed Source on WOLFSSL_PB Builds
On WOLFSSL_PB builds, wc_GenerateSeed fills the DRBG seed byte by byte from the vendor function UTL_Rand and returns success with no status check and no build warning. The function is not defined or seeded anywhere in the wolfSSL tree, so all DRBG output depends on a generator of unknown quality.
- Advisory
- BYTERAY-2026-0399
- CWE
- CWE-1213
- Vendor
- wolfSSL
- Product
- wolfSSL
- Reported
- 2026-09-28
- Disclosure
- 2026-12-03
- Affected
- wolfSSL 5.9.2 (tested at master commit d95483f), builds with WOLFSSL_PB (Nucleus 1.2 platform) and no custom seed override
- Credit
- Mehrun P. Hunter and Shahriyar Jalayeri, ByteRay Ltd.
Executive Summary
On builds that select the WOLFSSL_PB platform option (the Nucleus 1.2 platform), wc_GenerateSeed() fills the requested buffer one byte at a time from UTL_Rand(), a function supplied by the vendor SDK. It then returns success.
UTL_Rand() takes no seed argument. It is not seeded, declared or otherwise referenced anywhere else in the wolfSSL repository, and its implementation ships only in vendor firmware. Other weak-seed platform branches in the same file either emit a compile-time warning or query the vendor generator for a validity status. This branch does neither.
wc_GenerateSeed() is the only entropy input to the Hash_DRBG. TLS randoms, session tickets, IVs, key material and ECDSA nonces all inherit the quality of the vendor generator. Whether that generator is predictable cannot be established from the wolfSSL source. Default builds are not affected.
Affected Products and Versions
- Component:
wolfcrypt/src/random.c,wc_GenerateSeed(),WOLFSSL_PBbranch (wolfcrypt/src/random.c:8556-8567). - Required build:
WOLFSSL_PB, which selects the Nucleus 1.2 platform (wolfssl/wolfcrypt/settings.h:1563-1567), with no custom seed or block generator override. - Tested: wolfSSL master d95483fff72d6e987394b72edca433d4b580a0f4 (version string 5.9.2).
- A default build does not define
WOLFSSL_PBand is not affected. - Other releases were not checked.
Technical Details
The whole function is:
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
{
word32 i;
for (i = 0; i < sz; i++)
output[i] = UTL_Rand();
(void)os;
return 0;
}
wc_GenerateSeed()writesszbytes fromUTL_Rand()into the seed buffer (wolfcrypt/src/random.c:8562) and returns 0. There is no failure path._InitRng()uses the buffer to instantiate the Hash_DRBG (wolfcrypt/src/random.c:3135), andPollAndReSeed()uses it to reseed (wolfcrypt/src/random.c:4685).wc_RNG_GenerateBlock()serves all consumers from that DRBG: client and server randoms, session-ticket IVs, and TLS 1.3 handshake and key-share randomness.
Three properties set this branch apart from its neighbors. The source of the bytes is a vendor PRNG whose state and quality are outside the repository. There is no provider status check; the NetBurner branch at least calls RandomValid() after each byte (wolfcrypt/src/random.c:8822). And there is no compile-time warning, so an integrator is not told that the DRBG is only as strong as UTL_Rand(). Nothing in the tree shows that UTL_Rand() is weak. The defect is the unchecked and unannounced dependence on it as the only seed source.
Reachability and Preconditions
- Build:
WOLFSSL_PB, selected at compile time. Off by default. - No runtime configuration is involved. Every RNG instance on such a build is seeded this way.
- The attacker must be able to model or recover the state of the vendor generator. That depends on firmware that was not available for review.
- The attacker is otherwise a network peer or observer of TLS sessions from the device. No authentication is needed.
Impact
If the vendor generator is predictable, an attacker who models it can reproduce the DRBG output of the device and from that its TLS keying material, and can then decrypt or forge sessions. If the vendor generator is sound, there is no direct impact. The severity reflects that the consequence is conditional on firmware outside the repository while the affected surface is all randomness in the process.
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 stop treating the vendor PRNG as trusted entropy by default: gate the branch behind a warning or an error so that integrators accept it knowingly, mix in at least one independent entropy input, and add a status or health check so that a degraded generator causes a hard failure. Integrators on this platform can route seeding to a reviewed source today through CUSTOM_RAND_GENERATE_SEED or CUSTOM_RAND_GENERATE_BLOCK, and should validate the vendor implementation of UTL_Rand() on the target.
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.