Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,25 @@ AS_IF([test "x$ENABLED_AGENT" = "xyes"],
[AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSH_AGENT"])
AS_IF([test "x$ENABLED_CERTS" = "xyes"],
[AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSH_CERTS"])

# wolfSSL before 5.9.4 skips ancestor name constraints (CVE-2026-89133).
CERTS_OLD_WOLFSSL=no
AS_IF([test "x$ENABLED_CERTS" = "xyes"],[
AC_MSG_CHECKING([whether wolfSSL applies every CA's name constraints])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#ifdef WOLFSSL_USER_SETTINGS
#include <wolfssl/wolfcrypt/settings.h>
#else
#include <wolfssl/options.h>
#endif
#include <wolfssl/version.h>]],
[[#if LIBWOLFSSL_VERSION_HEX < 0x05009004
#error "older than 5.9.4"
#endif]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
CERTS_OLD_WOLFSSL=yes])])

AS_IF([test "x$ENABLED_OSSH_CERTS" = "xyes"],
[AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSH_OSSH_CERTS"])
dnl Initialize before the feature block so a stray WINCERT_LIBS value in the
Expand Down Expand Up @@ -655,3 +674,7 @@ AS_ECHO([" * X.509 Certs: $ENABLED_CERTS"])
AS_ECHO([" * OpenSSH Certs: $ENABLED_OSSH_CERTS"])
AS_ECHO([" * Windows cert store: $ENABLED_WINDOWS_CERT_STORE"])
AS_ECHO([" * Examples: $ENABLED_EXAMPLES"])

AS_IF([test "x$CERTS_OLD_WOLFSSL" = "xyes"],
[AC_MSG_WARN([X.509 certs are on, but this wolfSSL is older than 5.9.4 and does not apply the name constraints of CAs above a cert's issuer (CVE-2026-89133). A peer-supplied CA can authenticate a name outside its namespace. Upgrade wolfSSL to 5.9.4 or later.])],
[:])
10 changes: 10 additions & 0 deletions src/certman.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@

#ifdef WOLFSSH_CERTS

/* configure warns on its own and builds with -Werror */
#if defined(WOLFSSH_CERTS_OLD_NAME_CONSTRAINTS) && !defined(HAVE_CONFIG_H)
#ifdef _MSC_VER
#pragma message("warning: wolfSSL older than 5.9.4 does not apply " \
"ancestor CA name constraints (CVE-2026-89133); upgrade wolfSSL")
#else
#warning "wolfSSL older than 5.9.4 does not apply ancestor CA name constraints (CVE-2026-89133); upgrade wolfSSL"
#endif
#endif
Comment thread
philljj marked this conversation as resolved.
Resolved

#ifdef NO_INLINE
#include <wolfssh/misc.h>
#else
Expand Down
5 changes: 5 additions & 0 deletions wolfssh/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ extern "C" {
#define WOLFSSH_CERTMAN_CHAIN_CA
#endif

/* wolfSSL before 5.9.4 skips ancestor name constraints (CVE-2026-89133). */
#if defined(WOLFSSH_CERTS) && (LIBWOLFSSL_VERSION_HEX < WOLFSSL_V5_9_4)
#define WOLFSSH_CERTS_OLD_NAME_CONSTRAINTS
#endif

/* wc_MlDsaKey_* / WC_MLDSA_* naming replaced the wc_Dilithium_* API in
* wolfSSL 5.9.2. HAVE_DILITHIUM alone doesn't distinguish the two, so
* require the version that has the new API too. */
Expand Down
Loading