Public Security Advisories
Coordinated vulnerability disclosures from Argus. Findings, impact, and remediation, published in good faith.
For a list of embedded platform macros, and for Freescale builds with no RNG driver, wc_GenerateSeed compiles to a stub that fills the DRBG seed with the bytes 0, 1, 2 and so on. The build prints a warning and succeeds. Every random value the library then produces is the same on every device and every boot.
On Microchip PIC32 builds without the PIC32MZ hardware RNG, wolfSSL's seed function seeds the C library generator from the CPU core timer and returns rand() output as the DRBG seed. The core timer counts cycles since reset and is not secret, so the seed, and everything drawn from the DRBG, can be recomputed by search.
On EBSnet RTP builds, wolfSSL's seed function seeds the platform generator once from the system millisecond clock and returns rtp_rand() output as the DRBG seed. The whole seed is a function of one clock reading, so it, and everything drawn from the DRBG, can be recomputed by searching a window of milliseconds.
On INtime RTOS v5 and older, wolfSSL's seed function calls srand(time(0)) and returns rand() output as the DRBG seed. The only input is the calendar time in whole seconds, so the seed, and everything drawn from the DRBG, can be recomputed by trying the seconds around an observed session.
On Apache Mynewt builds, wolfSSL's seed function seeds the C library generator from the OS tick counter and returns rand() output as the DRBG seed. The tick counter is the time since boot and is not secret, so the seed, and everything drawn from the DRBG, can be recomputed by searching candidate uptimes.
On DDC-I Deos builds, wolfSSL's seed function seeds rand_r() from the system clock and returns its output as the DRBG seed. The clock value can be estimated and rand_r() is deterministic, so the seed, and everything drawn from the DRBG, can be recomputed by searching candidate clock values.
On Nucleus RTOS builds, wolfSSL's seed function seeds the C library generator from NU_Get_Time_Stamp() and returns rand() output as the DRBG seed. The time stamp is a system counter with no secret in it, so the seed, and everything drawn from the DRBG, can be recomputed by searching candidate counter values.
On Telit M2MB builds, wolfSSL's seed function seeds the C library generator from the millisecond field of the module's real-time clock and returns rand() output as the DRBG seed. Each clock read has at most 1000 possible values, so the seed, and everything drawn from the DRBG, can be recomputed by search.
On TI-RTOS builds, wolfSSL's seed function seeds the C library generator from the 32-bit XDC runtime timestamp and returns rand() output as the DRBG seed. The seed is a function of a few counter readings, so an observer who can bound them can recompute the DRBG state and every value drawn from it.
On VxWorks 6.x builds, wolfSSL's seed function takes the current time in seconds as the rand_r() state and returns rand_r() output as the DRBG seed. An observer who can bound the device clock at initialisation can recompute the DRBG state and every value drawn from it.
On builds that define DOLPHIN_EMULATOR or WOLFSSL_NDS, wc_GenerateSeed() calls srand(time(NULL)) and fills the DRBG seed from rand(). The seed is a function of the clock in whole seconds, so an observer who can bound that clock can recompute the DRBG state and every value drawn from it.
The settings file shipped with wolfSSL's NXP StarCore project selects my_rng_generate_seed() as the DRBG seed source. That function seeds rand() with the clock in seconds and returns rand() output, so an observer who can bound the device clock can recompute the DRBG state and every value drawn from it.
On Zephyr configurations without an entropy driver and a zephyr,entropy chosen node, wc_GenerateSeed() fills the DRBG seed from sys_rand_get(), a general-purpose generator, and returns success. On boards where that generator is deterministic, an observer who can model it can recompute the DRBG state.
The CryptoCell port keeps its RNG state, RNG work buffer and the function pointer used to generate random vectors as non-const globals declared in a public header. Code in the same image that overwrites them controls the randomness used for RSA and ECC key generation and signing on that device.
The IDIRECT_DEV_RANDOM seed function calls the platform getRandom provider, stores its return value in a variable that is never read, and returns 0. If the provider fails or returns fewer bytes than requested, the Hash_DRBG is seeded from whatever the buffer already held.
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.
On Infineon/Cypress HAL builds, wc_GenerateSeed returns success without writing the seed buffer when cyhal_trng_init fails. The DRBG is then seeded from whatever the buffer already held, and no error reaches the caller.
In builds that define the SHOW_SECRETS debug macro, wolfSSL_RAND_egd prints the entropy bytes it read from an EGD socket to standard output after mixing them into the global DRBG. The bytes are one input to the reseed; they do not by themselves determine the DRBG state.
wolfSSL_RAND_write_file writes 1024 bytes of DRBG output to an application-named seed file through a plain fopen call, so the file gets umask-governed permissions. The contents are generator output, not generator state; reading them does not by itself make later output predictable.
In builds for the Dolphin emulator and the Nintendo DS, wolfSSL's seed function calls srand(time(NULL)) and returns rand() output as the DRBG seed. The seed, and every random value derived from it, is a function of the wall-clock second at which the generator was initialised. These two targets are not selected by any default build.
wolfSSL contains a test seed function that returns the bytes 0, 1, 2 and so on. It is selected by WOLFSSL_GENSEED_FORTEST and also, with only a compiler warning, by a group of platform macros that have no entropy source of their own. A build that ships with it starts every random number generator from the same state. Default builds are not affected.
nrf_random_generate() initializes the Nordic RNG driver once, guarded by a plain static int that is tested and set without a lock. Two threads that request random data for the first time together both call the driver's init, and the call that is refused returns an RNG error to its caller.
The MAX3266X wc_GenerateSeed() records that the TRNG health test has passed in a plain static int, read before the hardware RNG mutex is taken and written after it is released. Threads that seed for the first time together each run the health test. The test itself stays serialized.
In builds with WOLFSSL_KCAPI and CUSTOM_RAND_GENERATE_BLOCK, wc_hwrng_generate_block fills the request from /dev/hwrng in a loop that treats only a return of -1 from read() as an error. A read that returns zero bytes makes no progress, so the loop never ends and the calling thread spins.
The entropy collection loop in wolfSSL_RAND_egd tests errno for EAGAIN or EINTR before it tests for a zero-entropy reply, without checking that the preceding call failed. With a stale errno value, every zero-entropy reply from the EGD daemon is retried and the loop never exits.
// No embargoed advisories.