← ALL ADVISORIES

LOW BYTERAY-2026-0530Disclosed

wolfSSL — Hash_DRBG Seeded from Pseudo-Random GetRandomByte Source on NetBurner Builds

On WOLFSSL_NETBURNER builds, wc_GenerateSeed fills the DRBG seed from the vendor GetRandomByte function, which the source itself labels pseudo-random in a compile-time warning. That seed is the only entropy input to the Hash_DRBG, so all DRBG output is as predictable as the vendor generator.

Advisory
BYTERAY-2026-0530
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 WOLFSSL_NETBURNER and no custom seed override
Credit
Mehrun P. Hunter and Shahriyar Jalayeri, ByteRay Ltd.

Executive Summary

On firmware built for the NetBurner target (WOLFSSL_NETBURNER), the NetBurner branch of wc_GenerateSeed() fills its output buffer one byte at a time from the vendor function GetRandomByte(). The source carries a compile-time warning that this material is pseudo-random.

That seed instantiates and reseeds the Hash_DRBG, and nothing else feeds it. Every value the library draws from the DRBG, such as TLS randoms, session IDs, ticket and record IVs, ephemeral key material and ECDSA nonces, is only as unpredictable as the vendor generator. An attacker who can predict that generator can reproduce DRBG output for a device built this way.

The exposure is bounded. Only builds that select the NetBurner target compile this branch, and the DRBG seed test rejects a constant seed stream. Default builds are not affected.

Affected Products and Versions

  • Component: wolfcrypt/src/random.c, wc_GenerateSeed(), NetBurner branch (wolfcrypt/src/random.c:8807-8827).
  • Required build: WOLFSSL_NETBURNER with no CUSTOM_RAND_GENERATE_SEED or CUSTOM_RAND_GENERATE_BLOCK override. The in-tree NetBurner configuration defines the macro (IDE/M68K/user_settings.h:18) and sets no override.
  • Tested: wolfSSL master d95483fff72d6e987394b72edca433d4b580a0f4 (version string 5.9.2).
  • A default build seeds from the operating system and is not affected.
  • Other releases were not checked.

Technical Details

The branch opens with #warning using NetBurner pseudo random GetRandomByte for seed (wolfcrypt/src/random.c:8808). The fill loop follows (wolfcrypt/src/random.c:8818-8824):

        for (i = 0; i < sz; i++) {
            output[i] = GetRandomByte();

            /* check if was a valid random number */
            if (!RandomValid())
                return RNG_FAILURE_E;
        }
  1. wc_GenerateSeed() writes sz bytes from GetRandomByte() into the seed buffer.
  2. After each byte it asks the vendor RandomValid() for status. That call reports the generator's own view of its health. It does not measure entropy, so it cannot flag a generator that is predictable but working.
  3. _InitRng() uses the buffer to instantiate the Hash_DRBG (wolfcrypt/src/random.c:3135), and PollAndReSeed() uses it to reseed (wolfcrypt/src/random.c:4685).
  4. wc_RNG_GenerateBlock() serves all consumers from that DRBG.

The one other control on the path is wc_RNG_TestSeed(), whose repetition count test fails a seed with a run of 31 identical bytes (wolfcrypt/src/random.c:2505-2507). It stops a stuck generator. It does not stop one that produces varying but predictable bytes.

Reachability and Preconditions

  • Build: WOLFSSL_NETBURNER, 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 observe the vendor generator well enough to predict its output. How predictable GetRandomByte() is depends on the NetBurner firmware and was not assessed.
  • There is no direct protocol trigger.

Impact

On affected builds, the unpredictability of TLS client and server randoms, session IDs, session-ticket IVs, key-agreement material and ECDSA nonces rests on a source that wolfSSL itself marks as pseudo-random. If the vendor generator is predictable to an attacker, DRBG output can be reproduced and keying material recovered. The practical outcome is a limited loss of confidentiality under that condition, not an unconditional break.

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 seed the NetBurner target from a real entropy source: the platform hardware RNG where one exists, or several independent on-device noise sources that are pooled and conditioned before use. The build should fail closed when no validated source is available, where it now only warns. Integrators can do this today by supplying their own source through CUSTOM_RAND_GENERATE_SEED or CUSTOM_RAND_GENERATE_BLOCK in the NetBurner settings.

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.

References