Seems reasonable. Alternatively you could take a daily-stable checkout.

Their normal release cycle is to make a new 'scheduled stable' once
every 2 months (i.e. unless they push an early release, 8.2612.0 around
20 Dec).

ok


On 2026/11/18 18:00, Mark Patruck wrote:
> Update sysutils/rsyslog to 8.2610.0 including upstream patches fixing
> multiple CVEs. I'm not familiar w/ the rsyslog release cycle, so i don't
> know why only source patches instead of new versions have been released
> (or if a new version comes soon).
> 
> Release notes:
> https://github.com/rsyslog/rsyslog/releases
> 
> 
> Updates to the port:
> - needs yaml (alternative configuration format)
> 
> - new 'impstats' module which uses archivers/snappy for compression
> 
> - needs protobuf-c (native protobuf encoding)
> 
> - build process needs USE_GMAKE=yes now
> 
> - multiple patches fixing CVEs have been added (as found on the
>   osssec ml)
> 
> Lightly tested (i'm not using rsyslog).
> 
> 
> 
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/sysutils/rsyslog/Makefile,v
> retrieving revision 1.60
> diff -u -p -r1.60 Makefile
> --- Makefile  26 Aug 2025 16:08:32 -0000      1.60
> +++ Makefile  18 Nov 2026 16:17:00 -0000
> @@ -6,14 +6,13 @@ COMMENT-elasticsearch =     Elasticsearch pl
>  
>  MULTI_PACKAGES =     -main -mysql -normalize -pgsql -elasticsearch
>  
> -V =                  8.2404.0
> +V =                  8.2610.0
>  DISTNAME =           rsyslog-$V
>  PKGNAME-main =               rsyslog-$V
>  PKGNAME-mysql =              rsyslog-mysql-$V
>  PKGNAME-normalize =  rsyslog-normalize-$V
>  PKGNAME-pgsql =              rsyslog-pgsql-$V
>  PKGNAME-elasticsearch =      rsyslog-elasticsearch-$V
> -REVISION =           1
>  
>  CATEGORIES =         sysutils
>  
> @@ -29,6 +28,7 @@ WANTLIB-main +=             c crypto curl estr fast
>  WANTLIB-main +=              gpg-error hogweed iconv idn2 intl m nettle 
> nghttp2
>  WANTLIB-main +=              p11-kit pthread relp ssl tasn1 unistring uuid z
>  WANTLIB-main +=              execinfo nghttp3 ngtcp2 ngtcp2_crypto_libressl
> +WANTLIB-main +=              yaml protobuf-c snappy
>  
>  WANTLIB-mysql +=     crypto m mariadb pthread ssl z
>  
> @@ -39,8 +39,11 @@ WANTLIB-pgsql +=   crypto m pq pthread ssl
>  WANTLIB-elasticsearch +=     crypto curl m nghttp2 pthread ssl z
>  WANTLIB-elasticsearch +=     nghttp3 ngtcp2 ngtcp2_crypto_libressl
>  
> -LIB_DEPENDS-main =   devel/libfastjson \
> +LIB_DEPENDS-main =   archivers/snappy \
> +                     devel/libfastjson \
>                       devel/libestr \
> +                     devel/libyaml \
> +                     devel/protobuf-c \
>                       net/curl \
>                       security/libgcrypt \
>                       security/gnutls \
> @@ -57,6 +60,8 @@ RUN_DEPENDS-elasticsearch = ${PKGNAME-ma
>  
>  SITES =                      https://www.rsyslog.com/files/download/rsyslog/
>  
> +USE_GMAKE=           Yes
> +
>  CONFIGURE_STYLE =    gnu
>  LIBTOOL_FLAGS =              --tag=disable-static
>  CONFIGURE_ARGS +=    --enable-pgsql \
> @@ -68,7 +73,8 @@ CONFIGURE_ARGS +=   --enable-pgsql \
>                       --enable-relp \
>                       --enable-elasticsearch \
>                       --enable-imfile
> -CONFIGURE_ENV +=     CPPFLAGS="-I${LOCALBASE}/include"
> +CONFIGURE_ENV +=     CPPFLAGS="-I${LOCALBASE}/include" \
> +                     LDFLAGS="-L${LOCALBASE}/lib"
>  
>  post-install:
>       rm ${PREFIX}/lib/rsyslog/*.la
> Index: distinfo
> ===================================================================
> RCS file: /cvs/ports/sysutils/rsyslog/distinfo,v
> retrieving revision 1.14
> diff -u -p -r1.14 distinfo
> --- distinfo  1 Aug 2024 14:23:03 -0000       1.14
> +++ distinfo  18 Nov 2026 16:17:00 -0000
> @@ -1,2 +1,2 @@
> -SHA256 (rsyslog-8.2404.0.tar.gz) = 
> MFKNFA7BsfB5IkCB+jffbgZYf/QrAuPmHy2qBSbFTTM=
> -SIZE (rsyslog-8.2404.0.tar.gz) = 3408657
> +SHA256 (rsyslog-8.2610.0.tar.gz) = 
> e9+V6B6mwO5dWGNC1X0qbjlbCJ+zxnMYoNxVWBbeQEs=
> +SIZE (rsyslog-8.2610.0.tar.gz) = 12179843
> Index: patches/patch-plugins_imdtls_imdtls_c
> ===================================================================
> RCS file: patches/patch-plugins_imdtls_imdtls_c
> diff -N patches/patch-plugins_imdtls_imdtls_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-plugins_imdtls_imdtls_c     18 Nov 2026 16:17:00 -0000
> @@ -0,0 +1,273 @@
> +Upstream fix for:
> +
> +     - 
> https://github.com/rsyslog/rsyslog/security/advisories/GHSA-4chq-f2r9-5jp8
> +
> +Index: plugins/imdtls/imdtls.c
> +--- plugins/imdtls/imdtls.c.orig
> ++++ plugins/imdtls/imdtls.c
> +@@ -35,6 +35,7 @@
> + #include <poll.h>
> + #include <assert.h>
> + #include <time.h>
> ++#include <limits.h>
> + 
> + // --- Include openssl headers as well
> + #include <openssl/ssl.h>
> +@@ -98,6 +99,10 @@ struct dtlsClient_s {
> +     SSL *sslClient; /* DTSL (SSL) Client */
> +     time_t lastActivityTime; /* Last Activity Time */
> +     int clientfd; /* ClientFD */
> ++    int peerVerified; /* post-handshake permitted-peer check completed */
> ++    long verifiedRenegotiations; /* handshake generation covered by 
> peerVerified */
> ++    short pollEvents; /* readiness needed by the handshake */
> ++    int drainPending; /* continue after the per-client read limit */
> + };
> + 
> + // Use typedef to define a type 'dtlsClient_t' based on 'struct 
> dtlsClient_s'
> +@@ -572,8 +577,34 @@ static void DTLScleanupSession(instanceConf_t *inst, i
> +     }
> +     inst->dtlsClients[idx]->sslClient = NULL;
> +     inst->dtlsClients[idx]->lastActivityTime = 0;
> ++    inst->dtlsClients[idx]->peerVerified = 0;
> ++    inst->dtlsClients[idx]->verifiedRenegotiations = 0;
> ++    inst->dtlsClients[idx]->pollEvents = POLLIN;
> ++    inst->dtlsClients[idx]->drainPending = 0;
> + }
> + 
> ++static int DTLSVerifySession(instanceConf_t *inst, int idx) {
> ++    dtlsClient_t *client = inst->dtlsClients[idx];
> ++    if (!SSL_is_init_finished(client->sslClient)) {
> ++        client->peerVerified = 0;
> ++        return 0;
> ++    }
> ++    long renegotiations = SSL_total_renegotiations(client->sslClient);
> ++    if (client->peerVerified && client->verifiedRenegotiations == 
> renegotiations) {
> ++        return 1;
> ++    }
> ++
> ++    if (imdtls_verify_callback(1, client->sslClient) == 0) {
> ++        LogMsg(0, RS_RET_NO_ERRCODE, LOG_WARNING, "imdtls: Cert Verify 
> FAILED for DTLS client idx (%d)", idx);
> ++        DTLScleanupSession(inst, idx);
> ++        return 0;
> ++    }
> ++    client->peerVerified = 1;
> ++    client->verifiedRenegotiations = renegotiations;
> ++    DBGPRINTF("imdtls: Cert Verify SUCCESS for DTLS client idx (%d)\n", 
> idx);
> ++    return 1;
> ++}
> ++
> + static void DTLSAcceptSession(instanceConf_t *inst, int idx) {
> +     int ret, err;
> +     SSL *ssl = inst->dtlsClients[idx]->sslClient;
> +@@ -587,7 +618,7 @@ static void DTLSAcceptSession(instanceConf_t *inst, in
> +         if (ret <= 0) {
> +             err = SSL_get_error(ssl, ret);
> +             if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) {
> +-                // Non-blocking operation did not complete; retry later
> ++                inst->dtlsClients[idx]->pollEvents = (err == 
> SSL_ERROR_WANT_WRITE) ? POLLIN | POLLOUT : POLLIN;
> +                 DBGPRINTF("imdtls: SSL_accept didn't complete (%d). Will 
> retry.\n", err);
> +             } else if (err == SSL_ERROR_SYSCALL) {
> +                 DBGPRINTF("imdtls: SSL_accept failed SSL_ERROR_SYSCALL idx 
> (%d), removing client.\n", idx);
> +@@ -602,18 +633,12 @@ static void DTLSAcceptSession(instanceConf_t *inst, in
> +         } else {
> +             DBGPRINTF("imdtls: SSL_accept success idx (%d), adding 
> client.\n", idx);
> +             inst->dtlsClients[idx]->lastActivityTime = time(NULL);
> +-
> +-            int status = 1;
> +-            status = imdtls_verify_callback(status, ssl);
> +-            if (status == 0) {
> +-                LogMsg(0, RS_RET_NO_ERRCODE, LOG_WARNING, "imdtls: Cert 
> Verify FAILED for DTLS client idx (%d)", idx);
> +-                DTLScleanupSession(inst, idx);
> +-            } else {
> +-                DBGPRINTF("imdtls: Cert Verify SUCCESS for DTLS client idx 
> (%d)\n", idx);
> +-            }
> ++            inst->dtlsClients[idx]->pollEvents = POLLIN;
> ++            DTLSVerifySession(inst, idx);
> +         }
> +     } else {
> +         DBGPRINTF("imdtls: SSL_get_state for DTLS client idx (%d) is %d\n", 
> idx, ret);
> ++        DTLSVerifySession(inst, idx);
> +     }
> + }
> + 
> +@@ -630,26 +655,44 @@ static void DTLSReadClient(instanceConf_t *inst, int i
> +     int err;
> +     SSL *ssl = inst->dtlsClients[idx]->sslClient;
> +     DBGPRINTF("imdtls: DEBUG Check Client activity on index %d.\n", idx);
> +-    if (revents & POLLIN) {
> ++    if (revents & (POLLIN | POLLOUT)) {
> +         if (ssl == NULL) {
> +             DBGPRINTF("imdtls: DTLSHandleSessions MISSING SSL OBJ for index 
> %d.\n", idx);
> +             return;
> +         }
> ++        if (!SSL_is_init_finished(ssl)) {
> ++            DTLSAcceptSession(inst, idx);
> ++            ssl = inst->dtlsClients[idx]->sslClient;
> ++            if (ssl == NULL || !SSL_is_init_finished(ssl)) {
> ++                return;
> ++            }
> ++        }
> ++        if (!DTLSVerifySession(inst, idx) || !(revents & 
> inst->dtlsClients[idx]->pollEvents)) {
> ++            return;
> ++        }
> +         DBGPRINTF("imdtls: Read Client activity on index %d.\n", idx);
> +         char buf[MAX_DTLS_MSGSIZE];
> +         int len = 0;
> ++        int reads = 0;
> ++        inst->dtlsClients[idx]->drainPending = 0;
> +         do {
> +             len = SSL_read(ssl, buf, sizeof(buf) - 1);
> +             if (len > 0) {
> ++                inst->dtlsClients[idx]->pollEvents = POLLIN;
> ++                if (!DTLSVerifySession(inst, idx)) {
> ++                    return;
> ++                }
> +                 buf[len] = '\0';
> +                 processMsg(inst, inst->dtlsClients[idx], buf, len);
> +             } else {
> +                 err = SSL_get_error(ssl, len);
> +                 if (err == SSL_ERROR_WANT_READ) {
> ++                    inst->dtlsClients[idx]->pollEvents = POLLIN;
> +                     DBGPRINTF("imdtls: SSL_ERROR_WANT_READ flush rbio on 
> index %d.\n", idx);
> +                     BIO *rbio = SSL_get_rbio(ssl);
> +                     BIO_flush(rbio);
> +                 } else if (err == SSL_ERROR_WANT_WRITE) {
> ++                    inst->dtlsClients[idx]->pollEvents = POLLIN | POLLOUT;
> +                     DBGPRINTF("imdtls: SSL_ERROR_WANT_WRITE flush wbio on 
> index %d.\n", idx);
> +                     BIO *wbio = SSL_get_wbio(ssl);
> +                     BIO_flush(wbio);
> +@@ -668,7 +711,15 @@ static void DTLSReadClient(instanceConf_t *inst, int i
> +                     break;
> +                 }
> +             }
> +-        } while (len > 0);
> ++            ++reads;
> ++        } while (len > 0 && reads < 32);
> ++        /* OpenSSL can retain complete DTLS records after the datagram 
> socket
> ++         * has been drained. Retry once on the next loop after the limit,
> ++         * even if poll reports no new socket data. A WANT_READ clears this
> ++         * flag, so an incomplete record cannot spin the event loop. */
> ++        if (len > 0 && reads == 32) {
> ++            inst->dtlsClients[idx]->drainPending = 1;
> ++        }
> +     }
> + }
> + 
> +@@ -678,6 +729,8 @@ static void DTLSHandleSessions(instanceConf_t *inst) {
> +     int optval = 1;
> +     int fdcount = 0;
> +     int ret, err;
> ++    int pollTimeout = -1;
> ++    time_t now = time(NULL);
> +     memset(clientIdxByPollSlot, -1, sizeof(clientIdxByPollSlot));
> +     memset(fds, 0, sizeof(fds));
> +     fds[0].fd = inst->sockfd;
> +@@ -696,13 +749,36 @@ static void DTLSHandleSessions(instanceConf_t *inst) {
> +             fdcount++;
> +             DBGPRINTF("imdtls: DTLSHandleSessions handle client %d (%d)\n", 
> fdcount, clientfd);
> +             fds[fdcount].fd = clientfd;
> +-            fds[fdcount].events = POLLIN;
> ++            fds[fdcount].events = inst->dtlsClients[i]->pollEvents;
> +             clientIdxByPollSlot[fdcount] = i;
> ++            if (inst->dtlsClients[i]->drainPending) {
> ++                pollTimeout = 0;
> ++            }
> ++
> ++            /* A nonblocking DTLS handshake needs its retransmission timer
> ++             * serviced even if no socket becomes ready. */
> ++            if (!SSL_is_init_finished(inst->dtlsClients[i]->sslClient)) {
> ++                struct timeval tv;
> ++                if (DTLSv1_get_timeout(inst->dtlsClients[i]->sslClient, 
> &tv)) {
> ++                    long long ms = (long long)tv.tv_sec * 1000 + 
> (tv.tv_usec + 999) / 1000;
> ++                    int delay = ms > INT_MAX ? INT_MAX : (int)ms;
> ++                    if (pollTimeout < 0 || delay < pollTimeout) {
> ++                        pollTimeout = delay;
> ++                    }
> ++                }
> ++            }
> ++            long long idleSeconds =
> ++                (long long)inst->timeout - (long long)difftime(now, 
> inst->dtlsClients[i]->lastActivityTime);
> ++            long long idleMs = idleSeconds <= 0 ? 0 : idleSeconds * 1000;
> ++            int idleDelay = idleMs > INT_MAX ? INT_MAX : (int)idleMs;
> ++            if (pollTimeout < 0 || idleDelay < pollTimeout) {
> ++                pollTimeout = idleDelay;
> ++            }
> +         }
> +     }
> + 
> +     DBGPRINTF("imdtls: Waiting for poll (clients %d) ...\n", fdcount);
> +-    ret = poll(fds, fdcount + 1, -1);
> ++    ret = poll(fds, fdcount + 1, pollTimeout);
> +     if (glbl.GetGlobalInputTermState() == 1) {
> +         DBGPRINTF("imdtls: DTLSHandleSessions Terminate State\n");
> +         return; /* terminate input! */
> +@@ -716,14 +792,25 @@ static void DTLSHandleSessions(instanceConf_t *inst) {
> +     DBGPRINTF("imdtls: DTLSHandleSessions handle client sockets (%d) \n", 
> fdcount);
> +     for (int i = 1; i <= fdcount; ++i) {
> +         if (clientIdxByPollSlot[i] >= 0) {
> +-            DTLSReadClient(inst, clientIdxByPollSlot[i], fds[i].revents);
> ++            int idx = clientIdxByPollSlot[i];
> ++            short revents = fds[i].revents | 
> (inst->dtlsClients[idx]->drainPending ? POLLIN : 0);
> ++            DTLSReadClient(inst, idx, revents);
> +         }
> +     }
> + 
> +     // Check session timeouts
> +     for (int i = 0; i < MAX_DTLS_CLIENTS; ++i) {
> +         if (inst->dtlsClients[i]->sslClient != NULL) {
> +-            if (difftime(time(NULL), 
> inst->dtlsClients[i]->lastActivityTime) > inst->timeout) {
> ++            if (!SSL_is_init_finished(inst->dtlsClients[i]->sslClient)) {
> ++                struct timeval tv;
> ++                if (DTLSv1_get_timeout(inst->dtlsClients[i]->sslClient, 
> &tv) && tv.tv_sec == 0 && tv.tv_usec == 0 &&
> ++                    DTLSv1_handle_timeout(inst->dtlsClients[i]->sslClient) 
> < 0) {
> ++                    DBGPRINTF("imdtls: DTLS retransmission failed for 
> client index %d.\n", i);
> ++                    DTLScleanupSession(inst, i);
> ++                    continue;
> ++                }
> ++            }
> ++            if (difftime(time(NULL), 
> inst->dtlsClients[i]->lastActivityTime) >= inst->timeout) {
> +                 DBGPRINTF("imdtls: Session timeout (%d) for client index 
> %d.\n", i, inst->timeout);
> +                 DTLScleanupSession(inst, i);
> +                 continue;
> +@@ -832,12 +919,25 @@ static void DTLSHandleSessions(instanceConf_t *inst) {
> +                     int addedClient = 0;
> +                     BIO_ctrl_set_connected(rbio, client_addr);
> +                     DBGPRINTF("imdtls: BIO_connect succeeded.\n");
> ++                    /* BIO_connect can reset the socket's blocking mode. Set
> ++                     * O_NONBLOCK only after the BIO has been connected. */
> ++                    int flags = fcntl(clientfd, F_GETFL, 0);
> ++                    if (flags < 0 || fcntl(clientfd, F_SETFL, flags | 
> O_NONBLOCK) < 0) {
> ++                        LogError(0, NO_ERRCODE, "imdtls: unable to make 
> client socket non-blocking");
> ++                        close(clientfd);
> ++                        SSL_free(ssl);
> ++                        break;
> ++                    }
> + 
> +                     // Add to DTLS Clients
> +                     for (int i = 0; i < MAX_DTLS_CLIENTS; ++i) {
> +                         if (inst->dtlsClients[i]->sslClient == NULL) {
> +                             inst->dtlsClients[i]->sslClient = ssl;
> +                             inst->dtlsClients[i]->lastActivityTime = 
> time(NULL);
> ++                            inst->dtlsClients[i]->peerVerified = 0;
> ++                            inst->dtlsClients[i]->verifiedRenegotiations = 
> 0;
> ++                            inst->dtlsClients[i]->pollEvents = POLLIN;
> ++                            inst->dtlsClients[i]->drainPending = 0;
> +                             DBGPRINTF("imdtls: New Client added at idx 
> %d.\n", i);
> +                             DTLSAcceptSession(inst, i);
> +                             addedClient = 1;
> +@@ -857,10 +957,11 @@ static void DTLSHandleSessions(instanceConf_t *inst) {
> +                 /* Retry on EAGAIN (recv timeout, no datagram) and on ret 
> == 0
> +                  * with an empty error queue (no usable handshake data 
> yet). */
> +                 if (err == SSL_ERROR_SYSCALL && (errno == EAGAIN || (ret == 
> 0 && ERR_peek_error() == 0))) {
> +-                    DBGPRINTF("imdtls: DTLSv1_listen RET %d (ERR %d / ERRNO 
> %d), retry\n", ret, err, errno);
> +-                    // Wait little and retry DTLSv1_listen
> +-                    srSleep(0, 100000);
> +-                    continue;
> ++                    DBGPRINTF("imdtls: DTLSv1_listen RET %d (ERR %d / ERRNO 
> %d), defer\n", ret, err, errno);
> ++                    /* DTLSv1_listen is stateless across the cookie 
> exchange.
> ++                     * Return to poll instead of waiting here for a second 
> flight. */
> ++                    SSL_free(ssl);
> ++                    break;
> +                 } else {
> +                     DBGPRINTF("imdtls: DTLSv1_listen RET %d (ERR %d / ERRNO 
> %d), abort\n", ret, err, errno);
> +                     net_ossl.osslLastOpenSSLErrorMsg(NULL, err, ssl, 
> LOG_WARNING, "DTLSHandleSessions",
> Index: patches/patch-plugins_imuxsock_imuxsock_c
> ===================================================================
> RCS file: patches/patch-plugins_imuxsock_imuxsock_c
> diff -N patches/patch-plugins_imuxsock_imuxsock_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-plugins_imuxsock_imuxsock_c 18 Nov 2026 16:17:00 -0000
> @@ -0,0 +1,279 @@
> +Upstream fix for 
> +     - 
> https://github.com/rsyslog/rsyslog/security/advisories/GHSA-6rqh-v5w3-r7h4
> +     - 
> https://github.com/rsyslog/rsyslog/security/advisories/GHSA-jcrj-xmp8-8hqf
> +     - 
> https://github.com/rsyslog/rsyslog/security/advisories/GHSA-w259-2hhm-9vr7
> +     - 
> https://github.com/rsyslog/rsyslog/security/advisories/GHSA-xrxr-7942-54fr
> +     - CVE-2026-129831 (correlates with GHSA-xrxr-7942-54fr)
> +
> +Index: plugins/imuxsock/imuxsock.c
> +--- plugins/imuxsock/imuxsock.c.orig
> ++++ plugins/imuxsock/imuxsock.c
> +@@ -782,10 +782,13 @@ static void fixPID(uchar *bufTAG, int *lenTag, struct 
> + 
> +     lenPID = snprintf(bufPID, sizeof(bufPID), "[%lu]:", (unsigned 
> long)cred->pid);
> + 
> +-    for (i = *lenTag; i >= 0 && bufTAG[i] != '['; --i) /*JUST SKIP*/
> ++    for (i = *lenTag - 1; i >= 0 && bufTAG[i] != '['; --i) /*JUST SKIP*/
> +         ;
> + 
> +-    if (i < 0) i = *lenTag - 1; /* go right at end of TAG, pid was not 
> present (-1 for ':') */
> ++    if (i < 0) {
> ++        i = *lenTag;
> ++        if (i > 0 && bufTAG[i - 1] == ':') --i;
> ++    }
> + 
> +     if (i + lenPID > CONF_TAG_MAXSIZE) return; /* do not touch, as things 
> would break */
> + 
> +@@ -866,29 +869,40 @@ finalize_it:
> +  * It is assumed the output buffer is large enough. Returns the number of
> +  * characters added.
> +  */
> +-static int copyescaped(uchar *dstbuf, uchar *inbuf, int inlen) {
> ++static size_t copyescaped(uchar *dstbuf, const uchar *inbuf, const int 
> inlen) {
> ++    static const uchar hex[] = "0123456789abcdef";
> +     int iDst, iSrc;
> + 
> +     *dstbuf = '"';
> +-    for (iDst = 1, iSrc = 0; iSrc < inlen; ++iDst, ++iSrc) {
> ++    for (iDst = 1, iSrc = 0; iSrc < inlen; ++iSrc) {
> +         if (inbuf[iSrc] == '"' || inbuf[iSrc] == '\\') {
> +             dstbuf[iDst++] = '\\';
> ++            dstbuf[iDst++] = inbuf[iSrc];
> ++        } else if (iscntrl((unsigned char)inbuf[iSrc])) {
> ++            dstbuf[iDst++] = '\\';
> ++            dstbuf[iDst++] = 'x';
> ++            dstbuf[iDst++] = hex[inbuf[iSrc] >> 4];
> ++            dstbuf[iDst++] = hex[inbuf[iSrc] & 0x0f];
> ++        } else {
> ++            dstbuf[iDst++] = inbuf[iSrc];
> +         }
> +-        dstbuf[iDst] = inbuf[iSrc];
> +     }
> +     dstbuf[iDst++] = '"';
> +-    return iDst;
> ++    return (size_t)iDst;
> + }
> + 
> + 
> +-static size_t escapedLen(uchar *inbuf, int inlen) {
> ++static size_t escapedLen(const uchar *inbuf, const int inlen) {
> +     size_t len = 2; /* surrounding quotes */
> + 
> +     for (int i = 0; i < inlen; ++i) {
> +         if (inbuf[i] == '"' || inbuf[i] == '\\') {
> ++            len += 2;
> ++        } else if (iscntrl((unsigned char)inbuf[i])) {
> ++            len += 4; /* \xNN */
> ++        } else {
> +             ++len;
> +         }
> +-        ++len;
> +     }
> +     return len;
> + }
> +@@ -909,6 +923,68 @@ finalize_it:
> + }
> + 
> + 
> ++static rsRetVal ensureTrustedPropSpace(
> ++    uchar **const dst, size_t *const dstLen, uchar *const stackDst, const 
> size_t used, const size_t extra) {
> ++    uchar *newDst;
> ++    size_t needed;
> ++    size_t newLen;
> ++    DEFiRet;
> ++
> ++    if (extra > (size_t)-1 - used) {
> ++        ABORT_FINALIZE(RS_RET_ERR);
> ++    }
> ++    needed = used + extra;
> ++    if (needed <= *dstLen) {
> ++        FINALIZE;
> ++    }
> ++
> ++    newLen = *dstLen;
> ++    while (newLen < needed) {
> ++        if (newLen > (size_t)-1 / 2) {
> ++            newLen = needed;
> ++        } else {
> ++            newLen *= 2;
> ++        }
> ++    }
> ++
> ++    if (*dst == stackDst) {
> ++        CHKmalloc(newDst = malloc(newLen));
> ++        memcpy(newDst, *dst, used);
> ++    } else {
> ++        CHKmalloc(newDst = realloc(*dst, newLen));
> ++    }
> ++    *dst = newDst;
> ++    *dstLen = newLen;
> ++
> ++finalize_it:
> ++    RETiRet;
> ++}
> ++
> ++
> ++static rsRetVal appendEscapedTrustedProp(uchar **const dst,
> ++                                         size_t *const dstLen,
> ++                                         uchar *const stackDst,
> ++                                         size_t *const offs,
> ++                                         const uchar *const name,
> ++                                         const size_t nameLen,
> ++                                         const uchar *const value,
> ++                                         const int valueLen) {
> ++    size_t escaped;
> ++    DEFiRet;
> ++
> ++    escaped = escapedLen(value, valueLen);
> ++    if (nameLen > (size_t)-1 - escaped || nameLen + escaped > (size_t)-1 - 
> 2) {
> ++        ABORT_FINALIZE(RS_RET_ERR);
> ++    }
> ++    CHKiRet(ensureTrustedPropSpace(dst, dstLen, stackDst, *offs, nameLen + 
> escaped + 2));
> ++    CHKiRet(appendTrustedProp(*dst, *dstLen, offs, name, nameLen));
> ++    *offs += copyescaped(*dst + *offs, value, valueLen);
> ++
> ++finalize_it:
> ++    RETiRet;
> ++}
> ++
> ++
> + /* submit received message to the queue engine
> +  * We now parse the message according to expected format so that we
> +  * can also mangle it if necessary.
> +@@ -945,7 +1021,7 @@ static rsRetVal SubmitMsg(uchar *pRcv, int lenRcv, lst
> +     parse++;
> +     pri = 0;
> +     priDigitCount = 0;
> +-    while (offs < lenMsg && isdigit(*parse)) {
> ++    while (offs < lenMsg && priDigitCount < 3 && isdigit(*parse)) {
> +         pri = pri * 10 + *parse - '0';
> +         ++parse;
> +         ++offs;
> +@@ -1021,22 +1097,17 @@ static rsRetVal SubmitMsg(uchar *pRcv, int lenRcv, 
> lst
> +         } else {
> +             uchar msgbuf[8192];
> +             uchar *pmsgbuf = msgbuf;
> +-            const size_t trustedPropBufLen = sizeof(propBuf) - 1;
> +-            const size_t trustedPropMaxExtra = 3 + /* " @[" */
> +-                                               96 + /* _PID/_UID/_GID tags 
> plus maximum decimal values */
> +-                                               7 + trustedPropBufLen + /* 
> _COMM= */
> +-                                               6 + trustedPropBufLen + /* 
> _EXE= */
> +-                                               10 + 2 + 2 * 
> trustedPropBufLen + /* _CMDLINE= plus escaped value */
> +-                                               2; /* closing bracket and 
> NUL */
> ++            const size_t trustedPropFixedExtra = 3 + /* " @[" */
> ++                                                 96 + /* _PID/_UID/_GID 
> tags plus maximum decimal values */
> ++                                                 2; /* closing bracket and 
> NUL */
> +             size_t msgbuf_size = sizeof(msgbuf);
> +             size_t toffs; /* offset for trusted properties */
> +-            size_t escaped;
> + 
> +-            if ((size_t)lenRcv > (size_t)-1 - trustedPropMaxExtra) {
> ++            if ((size_t)lenRcv > (size_t)-1 - trustedPropFixedExtra) {
> +                 ABORT_FINALIZE(RS_RET_ERR);
> +             }
> +-            if ((size_t)lenRcv + trustedPropMaxExtra > sizeof(msgbuf)) {
> +-                msgbuf_size = (size_t)lenRcv + trustedPropMaxExtra;
> ++            if ((size_t)lenRcv + trustedPropFixedExtra > sizeof(msgbuf)) {
> ++                msgbuf_size = (size_t)lenRcv + trustedPropFixedExtra;
> +                 CHKmalloc(pmsgbuf = malloc(msgbuf_size));
> +             }
> + 
> +@@ -1056,30 +1127,25 @@ static rsRetVal SubmitMsg(uchar *pRcv, int lenRcv, 
> lst
> +             }
> + 
> +             if (getTrustedProp(cred, "comm", propBuf, sizeof(propBuf), 
> &lenProp) == RS_RET_OK) {
> +-                if ((iRet = appendTrustedProp(pmsgbuf, msgbuf_size, &toffs, 
> (uchar *)" _COMM=", 7)) != RS_RET_OK ||
> +-                    (iRet = appendTrustedProp(pmsgbuf, msgbuf_size, &toffs, 
> propBuf, (size_t)lenProp)) != RS_RET_OK) {
> ++                if ((iRet = appendEscapedTrustedProp(&pmsgbuf, 
> &msgbuf_size, msgbuf, &toffs, (uchar *)" _COMM=", 7,
> ++                                                     propBuf, lenProp)) != 
> RS_RET_OK) {
> +                     if (pmsgbuf != msgbuf) free(pmsgbuf);
> +                     FINALIZE;
> +                 }
> +             }
> +             if (getTrustedExe(cred, propBuf, sizeof(propBuf), &lenProp) == 
> RS_RET_OK) {
> +-                if ((iRet = appendTrustedProp(pmsgbuf, msgbuf_size, &toffs, 
> (uchar *)" _EXE=", 6)) != RS_RET_OK ||
> +-                    (iRet = appendTrustedProp(pmsgbuf, msgbuf_size, &toffs, 
> propBuf, (size_t)lenProp)) != RS_RET_OK) {
> ++                if ((iRet = appendEscapedTrustedProp(&pmsgbuf, 
> &msgbuf_size, msgbuf, &toffs, (uchar *)" _EXE=", 6,
> ++                                                     propBuf, lenProp)) != 
> RS_RET_OK) {
> +                     if (pmsgbuf != msgbuf) free(pmsgbuf);
> +                     FINALIZE;
> +                 }
> +             }
> +             if (getTrustedProp(cred, "cmdline", propBuf, sizeof(propBuf), 
> &lenProp) == RS_RET_OK) {
> +-                if ((iRet = appendTrustedProp(pmsgbuf, msgbuf_size, &toffs, 
> (uchar *)" _CMDLINE=", 10)) != RS_RET_OK) {
> ++                if ((iRet = appendEscapedTrustedProp(&pmsgbuf, 
> &msgbuf_size, msgbuf, &toffs, (uchar *)" _CMDLINE=", 10,
> ++                                                     propBuf, lenProp)) != 
> RS_RET_OK) {
> +                     if (pmsgbuf != msgbuf) free(pmsgbuf);
> +                     FINALIZE;
> +                 }
> +-                escaped = escapedLen(propBuf, lenProp);
> +-                if (escaped > msgbuf_size || toffs > msgbuf_size - escaped) 
> {
> +-                    if (pmsgbuf != msgbuf) free(pmsgbuf);
> +-                    ABORT_FINALIZE(RS_RET_ERR);
> +-                }
> +-                toffs += (size_t)copyescaped(pmsgbuf + toffs, propBuf, 
> lenProp);
> +             }
> + 
> +             /* finalize string */
> +@@ -1107,14 +1173,20 @@ static rsRetVal SubmitMsg(uchar *pRcv, int lenRcv, 
> lst
> +         pMsg->msgFlags = pLstn->flags;
> +     }
> + 
> +-    if (pLstn->bUseSpecialParser) {
> ++    if (pLstn->bUseSpecialParser && priValid) {
> +         /* this is the legacy "log socket" parser which was written on the 
> assumption
> +          * that the log socket format would be fixed. While many folks said 
> so, it
> +          * seems to be different in practice, and this is why we now have 
> choices...
> +          * rgerhards, 2015-03-03
> +          */
> +-        parser.SanitizeMsg(pMsg);
> +-        lenMsg = pMsg->iLenRawMsg - offs; /* SanitizeMsg() may have changed 
> the size */
> ++        CHKiRet(parser.SanitizeMsg(pMsg));
> ++        /* Sanitizing may shorten the raw message. Never reuse a PRI cursor
> ++         * outside the current representation. */
> ++        if (offs >= pMsg->iLenRawMsg) {
> ++            pMsg->msgFlags |= NEEDS_PARSING;
> ++            goto submit;
> ++        }
> ++        lenMsg = pMsg->iLenRawMsg - offs;
> +         parse = pMsg->pszRawMsg + offs;
> +         msgSetPRI(pMsg, pri);
> +         MsgSetAfterPRIOffs(pMsg, priValid ? offs + 1 : 0);
> +@@ -1138,16 +1210,20 @@ static rsRetVal SubmitMsg(uchar *pRcv, int lenRcv, 
> lst
> +                 }
> +             }
> +         } else { /* if we pulled the time from the system, we need to 
> update the message text */
> +-            uchar *tmpParse = parse; /* just to check correctness of TS */
> +-            if (datetime.ParseTIMESTAMP3339(&dummyTS, &tmpParse, &lenMsg) 
> == RS_RET_OK ||
> +-                datetime.ParseTIMESTAMP3164(&dummyTS, &tmpParse, &lenMsg, 
> NO_PARSE3164_TZSTRING,
> ++            uchar *tmpParse = parse;
> ++            int remaining = lenMsg;
> ++            if (datetime.ParseTIMESTAMP3339(&dummyTS, &tmpParse, 
> &remaining) == RS_RET_OK ||
> ++                datetime.ParseTIMESTAMP3164(&dummyTS, &tmpParse, 
> &remaining, NO_PARSE3164_TZSTRING,
> +                                             NO_PERMIT_YEAR_AFTER_TIME) == 
> RS_RET_OK) {
> +-                /* We modify the message only if it contained a valid 
> timestamp,
> +-                otherwise we do not touch it at all. */
> +-                datetime.formatTimestamp3164(&st, (char *)parse, 0);
> +-                parse[15] = ' '; /* re-write \0 from fromatTimestamp3164 by 
> SP */
> +-                /* update "counters" to reflect processed timestamp */
> +-                parse += 16;
> ++                /* The permissive parsers accept timestamps shorter than 
> the fixed
> ++                 * replacement. Only overwrite bytes belonging to the 
> timestamp,
> ++                 * and keep the parser's cursor paired with its remaining 
> length. */
> ++                if (tmpParse - parse == 16) {
> ++                    datetime.formatTimestamp3164(&st, (char *)parse, 0);
> ++                    parse[15] = ' '; /* replace the formatter's terminating 
> NUL */
> ++                }
> ++                parse = tmpParse;
> ++                lenMsg = remaining;
> +             }
> +         }
> + 
> +@@ -1166,6 +1242,7 @@ static rsRetVal SubmitMsg(uchar *pRcv, int lenRcv, lst
> +         pMsg->msgFlags |= NEEDS_PARSING;
> +     }
> + 
> ++submit:
> +     MsgSetRcvFrom(pMsg, pLstn->hostName == NULL ? 
> glbl.GetLocalHostNameProp() : pLstn->hostName);
> +     CHKiRet(MsgSetRcvFromIP(pMsg, pLocalHostIP));
> +     MsgSetRuleset(pMsg, pLstn->pRuleset);
> Index: patches/patch-plugins_mmanon_mmanon_c
> ===================================================================
> RCS file: patches/patch-plugins_mmanon_mmanon_c
> diff -N patches/patch-plugins_mmanon_mmanon_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-plugins_mmanon_mmanon_c     18 Nov 2026 16:17:00 -0000
> @@ -0,0 +1,27 @@
> +Upstream fix for:
> +
> +     - 
> https://github.com/rsyslog/rsyslog/security/advisories/GHSA-f9hg-rj32-693x
> +
> +Index: plugins/mmanon/mmanon.c
> +--- plugins/mmanon/mmanon.c.orig
> ++++ plugins/mmanon/mmanon.c
> +@@ -1756,7 +1756,7 @@ static int syntax_embedded(const uchar *const __restri
> + 
> +     while (*nprocessed < buflen) {
> +         numLen = isValidHexNum(buf + *nprocessed, buflen - *nprocessed, 
> nprocessed, 1);
> +-        if (numLen > 0) {  // found a valid num
> ++        if (numLen > 0 && numLen < 5) {  // found a valid IPv6 group
> +             if ((ipParts == 6 && hadAbbrev) || ipParts > 6) {  // is 6 
> since the first part of
> +                 // IPv4 will also result in a valid hexvalue
> +                 isIP = 0;
> +@@ -1929,7 +1929,9 @@ static void anonEmbedded(wrkrInstanceData_t *pWrkrData
> + 
> +     int syn = syntax_embedded(*msg + offset, *pLenMsg - offset, &iplen, 
> &v4Start);
> +     if (syn) {
> +-        assert(iplen < sizeof(address));
> ++        if (iplen >= sizeof(address)) {
> ++            return;
> ++        }
> +         getip(*msg + offset, iplen, address);
> +         offset += iplen;
> +         process_embedded(address, pWrkrData, v4Start);
> Index: patches/patch-runtime_datetime_c
> ===================================================================
> RCS file: patches/patch-runtime_datetime_c
> diff -N patches/patch-runtime_datetime_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-runtime_datetime_c  18 Nov 2026 16:17:00 -0000
> @@ -0,0 +1,22 @@
> +Upstream fix for:
> +
> +     - 
> https://github.com/rsyslog/rsyslog/security/advisories/GHSA-5pc2-f2v7-5w5p
> +
> +Index: runtime/datetime.c
> +--- runtime/datetime.c.orig
> ++++ runtime/datetime.c
> +@@ -1187,6 +1187,7 @@ int getWeekdayNbr(struct syslogTime *ts) {
> +     }
> +     wday = ((36525 * g) / 100) + ((306 * f) / 10) + ts->day - 621049;
> +     wday %= 7;
> ++    if (wday < 0) wday += 7;
> +     return wday;
> + }
> + 
> +@@ -1387,4 +1388,4 @@ BEGINAbstractObjClassInit(datetime, 1, OBJ_IS_CORE_MOD
> + ENDObjClassInit(datetime)
> + 
> + /* vi:set ai:
> +- */
> +\ No newline at end of file
> ++ */
> Index: patches/patch-runtime_net_ossl_c
> ===================================================================
> RCS file: patches/patch-runtime_net_ossl_c
> diff -N patches/patch-runtime_net_ossl_c
> --- patches/patch-runtime_net_ossl_c  1 Aug 2024 14:23:03 -0000       1.1
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -1,46 +0,0 @@
> -LibreSSL does not support SSL_CONF_cmd.
> -This is already present in rsyslog master and will most likely ship
> -with a future version.
> -https://github.com/rsyslog/rsyslog/commit/b79fd513271bdd02d8a37fa4197d2f293aaf6d11
> -
> -Index: runtime/net_ossl.c
> ---- runtime/net_ossl.c.orig
> -+++ runtime/net_ossl.c
> -@@ -59,7 +59,9 @@ void net_ossl_set_ssl_verify_callback(SSL *pSsl, int f
> - void net_ossl_set_ctx_verify_callback(SSL_CTX *pCtx, int flags);
> - void net_ossl_set_bio_callback(BIO *conn);
> - int net_ossl_verify_callback(int status, X509_STORE_CTX *store);
> -+#if OPENSSL_VERSION_NUMBER >= 0x10002000L && 
> !defined(LIBRESSL_VERSION_NUMBER)
> - rsRetVal net_ossl_apply_tlscgfcmd(net_ossl_t *pThis, uchar *tlscfgcmd);
> -+#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L
> - rsRetVal net_ossl_chkpeercertvalidity(net_ossl_t *pThis, SSL *ssl, uchar 
> *fromHostIP);
> - X509* net_ossl_getpeercert(net_ossl_t *pThis, SSL *ssl, uchar *fromHostIP);
> - rsRetVal net_ossl_peerfingerprint(net_ossl_t *pThis, X509* certpeer, uchar 
> *fromHostIP);
> -@@ -472,6 +474,7 @@ void net_ossl_lastOpenSSLErrorMsg
> -     }
> - }
> - 
> -+#if OPENSSL_VERSION_NUMBER >= 0x10002000L && 
> !defined(LIBRESSL_VERSION_NUMBER)
> - /* initialize tls config commands in openssl context
> -  */
> - rsRetVal net_ossl_apply_tlscgfcmd(net_ossl_t *pThis, uchar *tlscfgcmd)
> -@@ -557,8 +560,8 @@ rsRetVal net_ossl_apply_tlscgfcmd(net_ossl_t *pThis, u
> - finalize_it:
> -     RETiRet;
> - }
> -+#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L
> - 
> --
> - /* Convert a fingerprint to printable data. The  conversion is carried out
> -  * according IETF I-D syslog-transport-tls-12. The fingerprint string is
> -  * returned in a new cstr object. It is the caller's responsibility to
> -@@ -1195,7 +1198,9 @@ CODESTARTobjQueryInterface(net_ossl)
> -     pIf->osslPeerfingerprint        = net_ossl_peerfingerprint;
> -     pIf->osslGetpeercert            = net_ossl_getpeercert;
> -     pIf->osslChkpeercertvalidity    = net_ossl_chkpeercertvalidity;
> -+#if OPENSSL_VERSION_NUMBER >= 0x10002000L && 
> !defined(LIBRESSL_VERSION_NUMBER)
> -     pIf->osslApplyTlscgfcmd         = net_ossl_apply_tlscgfcmd;
> -+#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L
> -     pIf->osslSetBioCallback         = net_ossl_set_bio_callback;
> -     pIf->osslSetCtxVerifyCallback   = net_ossl_set_ctx_verify_callback;
> -     pIf->osslSetSslVerifyCallback   = net_ossl_set_ssl_verify_callback;
> Index: patches/patch-runtime_net_ossl_h
> ===================================================================
> RCS file: patches/patch-runtime_net_ossl_h
> diff -N patches/patch-runtime_net_ossl_h
> --- patches/patch-runtime_net_ossl_h  1 Aug 2024 14:23:03 -0000       1.1
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -1,18 +0,0 @@
> -LibreSSL does not support SSL_CONF_cmd.
> -This is already present in rsyslog master and will most likely ship
> -with a future version.
> -https://github.com/rsyslog/rsyslog/commit/b79fd513271bdd02d8a37fa4197d2f293aaf6d11
> -
> -Index: runtime/net_ossl.h
> ---- runtime/net_ossl.h.orig
> -+++ runtime/net_ossl.h
> -@@ -88,7 +88,9 @@ BEGINinterface(net_ossl) /* name must also be changed 
> -     rsRetVal (*osslPeerfingerprint)(net_ossl_t *pThis, X509* certpeer, 
> uchar *fromHostIP);
> -     X509* (*osslGetpeercert)(net_ossl_t *pThis, SSL *ssl, uchar 
> *fromHostIP);
> -     rsRetVal (*osslChkpeercertvalidity)(net_ossl_t *pThis, SSL *ssl, uchar 
> *fromHostIP);
> -+#if OPENSSL_VERSION_NUMBER >= 0x10002000L && 
> !defined(LIBRESSL_VERSION_NUMBER)
> -     rsRetVal (*osslApplyTlscgfcmd)(net_ossl_t *pThis, uchar *tlscfgcmd);
> -+#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L
> -     void (*osslSetBioCallback)(BIO *conn);
> -     void (*osslSetCtxVerifyCallback)(SSL_CTX *pCtx, int flags);
> -     void (*osslSetSslVerifyCallback)(SSL *pSsl, int flags);
> Index: patches/patch-runtime_template_c
> ===================================================================
> RCS file: patches/patch-runtime_template_c
> diff -N patches/patch-runtime_template_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-runtime_template_c  18 Nov 2026 16:17:00 -0000
> @@ -0,0 +1,16 @@
> +Upstream fix for:
> +
> +     - 
> https://github.com/rsyslog/rsyslog/security/advisories/GHSA-cg8j-rwxh-vrg3
> +
> +Index: runtime/template.c
> +--- runtime/template.c.orig
> ++++ runtime/template.c
> +@@ -1161,7 +1161,7 @@ rsRetVal doEscape(uchar **pp, rs_size_t *pLen, unsigne
> +     else if (mode == SQL_ESCAPE)
> +         for (p = *pp; *p && *p != '\'' && *p != '\\'; ++p);
> +     else if (mode == JSON_ESCAPE)
> +-        for (p = *pp; *p && (*p == '"' || *p == '\\'); ++p);
> ++        for (p = *pp; *p && *p != '"' && *p != '\\'; ++p);
> +     /* when we get out of the loop, we are either at the
> +      * string terminator or the first character to escape */
> +     if (p && *p == '\0') FINALIZE; /* nothing to do in this case! */
> Index: pkg/PLIST-main
> ===================================================================
> RCS file: /cvs/ports/sysutils/rsyslog/pkg/PLIST-main,v
> retrieving revision 1.10
> diff -u -p -r1.10 PLIST-main
> --- pkg/PLIST-main    8 Nov 2022 11:17:12 -0000       1.10
> +++ pkg/PLIST-main    18 Nov 2026 16:17:00 -0000
> @@ -7,6 +7,7 @@ lib/rsyslog/
>  @so lib/rsyslog/imfile.so
>  @so lib/rsyslog/imklog.so
>  @so lib/rsyslog/immark.so
> +@so lib/rsyslog/impstats.so
>  @so lib/rsyslog/imrelp.so
>  @so lib/rsyslog/imtcp.so
>  @so lib/rsyslog/imudp.so
> @@ -22,6 +23,8 @@ lib/rsyslog/
>  @so lib/rsyslog/lmtcpsrv.so
>  @so lib/rsyslog/lmzlibw.so
>  @so lib/rsyslog/mmexternal.so
> +@so lib/rsyslog/mmleefparse.so
> +@so lib/rsyslog/omkinesis.so
>  @so lib/rsyslog/ommail.so
>  @so lib/rsyslog/omrelp.so
>  @so lib/rsyslog/omtesting.so
> 
> 
> 
> --
> Mark Patruck ( mark at wrapped.cx )
> GPG key 0xF2865E51 / 187F F6D3 EE04 1DCE 1C74  F644 0D3C F66F F286 5E51
>  
> https://www.wrapped.cx
> 

Reply via email to