← ALL ADVISORIES

MEDIUM BYTERAY-2026-0347Patched

wolfSSL — CR/LF Injection in CRL Issuer Name Printed by wolfSSL_X509_CRL_print

wolfSSL_X509_CRL_print writes the CRL issuer name to the output without escaping control characters. A CRL whose issuer contains CR or LF adds lines of its author's choosing to the printed text. The CRL does not need a valid signature to be loaded and printed. Applications that print CRLs from untrusted sources into line-based output are affected.

Advisory
BYTERAY-2026-0347
CWE
CWE-144
CVSS
5.3 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N)
Vendor
wolfSSL
Product
wolfSSL
Reported
2026-09-28
Disclosure
2026-12-03
Affected
wolfSSL 5.9.2 through 5.9.4, builds with OPENSSL_EXTRA and HAVE_CRL whose application prints untrusted CRLs with wolfSSL_X509_CRL_print
Fixed in
Master commit b1a13054ea93064bf87e38f03daf7e30e698149a (PR 11682, merged 2026-10-15). Not in a wolfSSL stable release as of 2026-12-03.
Credit
Mehrun P. Hunter and Shahriyar Jalayeri, ByteRay Ltd.

Executive Summary

wolfSSL_X509_CRL_print produces a text dump of a certificate revocation list. Its Issuer: line is written by the helper that also prints certificate names, and that helper asks the name printer for no escaping.

The issuer is decoded from the CRL as received. If one of its attribute values contains CR or LF, the bytes are written unchanged and the dump gains extra lines. A reader, or a program that parses the text, cannot tell them from lines the application produced.

The compatibility-layer functions that turn bytes into a printable CRL object do not verify the CRL signature, so anyone who can hand the application a CRL can choose the issuer. The code is not part of a default build, and wolfSSL never prints a CRL on its own.

Affected Products and Versions

  • Component: src/x509.c, wolfSSL_X509_CRL_print(), through X509PrintName().
  • Required build: OPENSSL_EXTRA and HAVE_CRL, with BIO support and XSNPRINTF (src/x509.c:9352, src/x509.c:9892, src/x509.c:10242-10244). Both options are off by default (configure.ac:3314-3318, configure.ac:9144-9148).
  • Tested: wolfSSL master d95483fff72d6e987394b72edca433d4b580a0f4 (version string 5.9.2).
  • The v5.9.2-stable and v5.9.4-stable tags contain the same code path.
  • Fixed on master. No wolfSSL release contains the fix.
  • A default ./configure build does not include this code. Earlier releases were not checked.

Technical Details

The print function hands the issuer to X509PrintName() (src/x509.c:10210-10213):

    if (X509PrintName(bio, wolfSSL_X509_CRL_get_issuer_name(crl), issuType, 8)
            != WOLFSSL_SUCCESS) {
        return WOLFSSL_FAILURE;
    }

X509PrintName() calls wolfSSL_X509_NAME_print_ex(bio, name, 1, 0) and then writes a newline (src/x509.c:7875-7880). The fourth argument is the flag word. The escaping routine replaces control characters only when WOLFSSL_ASN1_STRFLGS_ESC_CTRL is set (src/x509.c:15642-15645), so with flags of 0 every byte of each value goes to the BIO as it is.

How the bytes arrive:

  1. wolfSSL_d2i_X509_CRL() creates a CRL object that is not attached to a certificate manager and loads the input with verification off (src/x509.c:9550, src/x509.c:9561-9562). The BIO, file and PEM readers call the same function (src/x509.c:9369, src/x509.c:14338).
  2. With verification off, the loader keeps a CRL whose signer is unknown (src/crl.c:960-968).
  3. While building the entry, the issuer is decoded from the CRL's own bytes into a name object (src/crl.c:176-181).
  4. The name parser stores each attribute value with its encoded length and does not inspect the characters (wolfcrypt/src/asn.c:15727-15732).
  5. wolfSSL_X509_CRL_print() prints that name with flags of 0.

The rest of the CRL dump was checked. The revoked-certificate section prints serial numbers as hex and dates through the time formatter (src/x509.c:10037-10106); it does not carry free text.

Reachability and Preconditions

  • The application obtains a CRL from a source an attacker can influence and calls wolfSSL_X509_CRL_print on it. Examples are a tool that displays CRL files, or a service that fetches a CRL itself and logs what it received.
  • The output goes somewhere line structure matters: a log, an audit record, a terminal, or text that another program parses.
  • No valid signature is needed, because the object is loaded without verification.
  • wolfSSL's own CRL handling during certificate verification does not print anything. A deployment that only loads CRLs into the certificate manager is not affected.

Impact

Confirmed from source: CR, LF and other control bytes in a CRL issuer attribute reach the output BIO unchanged, and the CRL author controls the text after the injected line break. The effect is limited to the printed text. It allows forged or split lines in whatever consumes the dump, and control bytes such as ESC also pass through to a terminal. Revocation decisions are not affected. How serious this is depends on whether the application prints CRLs it has not authenticated, which is a deployment choice.

ByteRay did not build a proof of concept for this issue. The analysis is from source review.

Remediation and Mitigation

Fixed on master by commit b1a13054ea93064bf87e38f03daf7e30e698149a, part of PR 11682, merged 2026-10-15. The commit makes X509PrintName() pass WOLFSSL_ASN1_STRFLGS_ESC_CTRL, so a control byte in the issuer is printed as a backslash followed by two hex digits. The pull request also adds a CRL print test for this case. The fix is on master only. No wolfSSL release contains it as of 2026-12-03; the newest release tag, v5.9.4-stable, does not. The tag rust/wolfssl-wolfcrypt/v3.0.0, which marks a version of the Rust wrapper, points at a master snapshot that includes it.

Until a release is available: print untrusted CRLs into a memory BIO and escape or reject control characters before the text reaches a log or terminal, or print only CRLs whose origin the application has already authenticated.

This is the same helper and the same commit as BYTERAY-2026-0351 (certificate subject and issuer) and BYTERAY-2026-0348 (certificate request subject).

Timeline

  • 2026-09-28 — Reported to wolfSSL.
  • 2026-10-07 — Pull request 11682 opened upstream.
  • 2026-10-15 — Pull request 11682 merged to master.
  • 2026-12-03 — Public disclosure.

Credits

Discovered and reported by Mehrun P. Hunter and Shahriyar Jalayeri of ByteRay Ltd.

References