🚀 New: chi (χ) — an open-source autoresearch harness for fleets of LLM coding agents. Read the announcement.

librelp's certvalid Mode Never Checked a Certificate Under GnuTLS. The OpenSSL Workaround Trusted the System CA Store

CVE-2026-132888: librelp added the certvalid TLS auth mode to its OpenSSL backend in 2018 and never to the GnuTLS verify callback, so RELP over GnuTLS accepted any certificate. Before 1.14.0, the suggested OpenSSL workaround also trusted the system CA store when no CA file was set.

Contents

librelp 1.14.0, released on November 26, fixes CVE-2026-132888. If rsyslog speaks RELP over TLS with tls.authMode="certvalid" and the GnuTLS driver, the peer certificate was not checked at all. A server running imrelp accepted any client certificate, including a self-signed one, so anyone who could reach port 2514 could inject logs that look like they came from a trusted host. A client running omrelp accepted any server certificate, so anyone on the path could receive the forwarded logs. The advisory lists every release from 1.2.18 (September 2018) through 1.13.0 as affected.

GnuTLS is also what librelp picks when it was built with both TLS libraries. The engine constructor in src/relp.c falls back to OpenSSL only when GnuTLS support is absent, and rsyslog’s tls.tlsLib documentation says “gnutls” is “the current default for historic reasons.” A config that never mentions a TLS library can be on the affected path.

The bug itself is a few missing lines. The more useful lesson is in how it stayed hidden for eight years, and in what happens if you follow the advisory’s “use OpenSSL instead” workaround on an older release.

One mode, two backends, one implementation

certvalid is a librelp-specific mode. rsyslog’s tls.authMode reference describes it as checking the chain “but does not check the subject name, so any certificate trusted by the configured CAs is accepted.” It sits between fingerprint (pin one certificate) and name (chain plus permitted-peer name match).

The 1.2.18 ChangeLog entry is one line: “added non-standard “certvalid” auth mode to TLS authentication.” In the 1.2.18 source, the mode appears in the OpenSSL path, relpTcpChkPeerAuth, which first checks SSL_get_verify_result and then dispatches on the mode. It does not appear in the GnuTLS verify callback. Here is that callback’s dispatch as of 1.13.0 (src/tcp.c, relpTcpVerifyCertificateCallback), unchanged in substance since 2018:

int r = 0;
/* ... peer certificate list fetched, first cert imported ... */
if(pThis->authmode == eRelpAuthMode_Fingerprint) {
    r = relpTcpChkPeerFingerprint(pThis, cert);
} else if(pThis->authmode == eRelpAuthMode_Name){
    r = relpTcpChkPeerName(pThis, (void*)cert);
}

if(r != 0) goto done;

/* notify gnutls to continue handshake normally */
r = 0;

In name mode, relpTcpChkPeerName_gtls calls gnutls_certificate_verify_peers2 before matching names, so the chain is checked. In fingerprint mode, the pin is the check. In certvalid mode, neither branch runs, r keeps its initial value of 0, and the callback returns 0.

Why GnuTLS did not catch it

Registering a callback with gnutls_certificate_set_verify_function makes the callback the verification step. The GnuTLS API reference says the callback “should return 0 for the handshake to continue or non-zero to terminate,” and points to gnutls_certificate_verify_peers2() as the way to verify inside it. The certificate credentials chapter is more direct: the peer’s certificate is verified automatically only “if gnutls_session_set_verify_cert is called prior to handshake.” Otherwise “one must set a callback function”, and the verification “should happen using gnutls_certificate_verify_peers3 within the callback.”

So GnuTLS never had an independent opinion. Loading a CA file with gnutls_certificate_set_x509_trust_file, which librelp does when you set tls.caCert, populates the trust list. Nothing consults it unless someone calls a verify function. OpenSSL’s model is different: with SSL_VERIFY_PEER, the library builds and checks the chain during the handshake and the application inspects the result. A mode added only to the OpenSSL dispatch inherited real chain validation there. The same mode on GnuTLS inherited nothing.

The fix (commit e616484) adds the missing branch, which calls gnutls_certificate_verify_peers2 and rejects any nonzero status. It also adds the line that would have turned this into a loud failure in 2018:

} else if(pThis->authmode == eRelpAuthMode_CertValid) {
    r = relpTcpChkPeerCertValid_gtls(pThis);
} else {
    r = GNUTLS_E_CERTIFICATE_ERROR;
}

An unknown auth mode now fails the handshake. If you maintain a wrapper with more than one TLS backend, that else is the part to copy: mode dispatch in a verification path should end in a rejection, and the initial value of the result should be a failure, not success.

The workaround had its own problem

The advisory’s workarounds are to switch to fingerprint or name, or to use the OpenSSL driver. The OpenSSL one needs a caveat for anyone staying on 1.13.0 or earlier.

In 1.13.0, relpTcpInitTLS sets up trust for the OpenSSL backend like this when tls.caCert is absent. It loads your own certificate file as a trust anchor, then calls SSL_CTX_set_default_verify_paths, which loads the system CA store:

} else {
    /* Init CA from own Certificate */
    if( pThis->ownCertFile != NULL ) {
        if (SSL_CTX_load_verify_locations(ctx, pThis->ownCertFile, NULL) != 1) {
            /* ... error ... */
        }
    }
    // Init local System default certificate storage instead.
    if (SSL_CTX_set_default_verify_paths(ctx) != 1) {
        /* ... error ... */
    }
}

Combine that with certvalid, which checks the chain and ignores the name. An omrelp client without tls.caCert accepts any server certificate that chains to a root in the system store, for any hostname. Anyone who can intercept the connection and holds an ordinary publicly issued TLS certificate for a domain they control can receive your logs. On the server side, imrelp accepts any client certificate that OpenSSL can chain to those roots. And if tls.myCert points to a full-chain file, every CA certificate in that file becomes a trust anchor too, including the intermediate that issued your own certificate, so anything else that intermediate signed passes.

1.14.0 removes both fallbacks (1dee790, d51ec49). The ChangeLog marks both as BEHAVIOUR CHANGE: without a configured CA file, neither your own certificate nor the system store is trusted. The new regression test tls-ossl-certvalid-no-trust-anchor.sh points SSL_CERT_FILE at the test CA and expects the handshake to fail.

That cuts both ways. If you set tls.caCert everywhere, nothing changes for you. If some config relied on the implicit trust, it stops connecting after the upgrade.

A client without its own certificate stopped verifying

A third fix in the release is smaller but has the same shape. In 1.13.0, isAnonAuth was:

return pThis->ownCertFile == NULL;

A RELP client configured with name mode and a CA file, but no client certificate of its own, counted as anonymous. On the OpenSSL path, relpTcpConnectTLSInit then overwrote the configured mode with eRelpAuthMode_None, so the permitted-peer name check never ran and the peer check ended in its “anon mode - success” branch. On the GnuTLS path, the client allocated anonymous credentials instead of certificate credentials. The fix (587e1fe) treats a client as anonymous only when its configured mode is also none. The ChangeLog describes the result as “a client without its own certificate still verifies the server”, and the new test tls-client-auth-no-cert.sh fails if a certificate-less client in name mode delivers a message to an untrusted server.

All three bugs fail open. A missing branch, a missing config value or a missing file made librelp verify less than the config said, and the only trace was debug output.

What to change

  • Upgrade to librelp 1.14.0 and restart rsyslog. Fixes in a shared library do nothing until the process reloads it.
  • Before upgrading, grep your rsyslog configs for imrelp and omrelp actions with tls="on". Any that lack tls.caCert were relying on implicit trust on the OpenSSL path and will fail the handshake on 1.14.0. Add an explicit CA file that contains only the CA you issue log certificates from.
  • Prefer tls.authMode="name" with tls.permittedPeer over certvalid. The rsyslog docs call certvalid weaker than name. Even when it works as intended, it trusts every certificate your CA has ever issued.
  • If you must stay on an older release for now, don’t treat “switch to OpenSSL” as enough. Set tls.caCert explicitly, or move to fingerprint or name.
  • If your distribution backports the fix instead of shipping 1.14.0, check which of these commits the patch includes. The GnuTLS fix and the OpenSSL trust-store changes are separate commits.

One timing detail: the fixes were merged to librelp’s main branch on August 20, 2026, with regression tests that name the bypasses. The release and advisory came on November 26. For about three months, anyone reading the commit log could see the problem while the latest release still had it. If a project you depend on works in public, its commit log is part of your advisory feed.

Sources