Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package sipgrep for openSUSE:Factory checked in at 2026-11-16 09:08:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/sipgrep (Old) and /work/SRC/openSUSE:Factory/.sipgrep.new.1251 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "sipgrep" Mon Nov 16 09:08:06 2026 rev:4 rq:1397551 version:2.2.5 Changes: -------- --- /work/SRC/openSUSE:Factory/sipgrep/sipgrep.changes 2026-08-24 12:15:27.350179925 +0200 +++ /work/SRC/openSUSE:Factory/.sipgrep.new.1251/sipgrep.changes 2026-11-16 09:13:40.217878939 +0100 @@ -1,0 +2,11 @@ +Sat Nov 14 09:33:51 UTC 2026 - Andreas Stieger <[email protected]> + +- update to 2.2.5: + * Reject IPv4 fragments whose total length is shorter than the + header. A short ip_len wrapped the fragment length and + reassembly wrote past a heap buffer (GHSA-4rgx-gv78-gv3w) + * Ignore a negative Content-Length in both SIP parsers so it is + not used as a buffer length. This covers the default dialog + parser and -m. + +------------------------------------------------------------------- Old: ---- sipgrep-2.2.4.tar.gz New: ---- sipgrep-2.2.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sipgrep.spec ++++++ --- /var/tmp/diff_new_pack.S14iPt/_old 2026-11-16 09:13:41.201920195 +0100 +++ /var/tmp/diff_new_pack.S14iPt/_new 2026-11-16 09:13:41.202920237 +0100 @@ -1,7 +1,7 @@ # # spec file for package sipgrep # -# Copyright (c) 2026 Andreas Stieger <[email protected]> +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -14,6 +14,16 @@ # Please submit bugfixes or comments via https://bugs.opensuse.org/ # +# Copyright (c) 2026 Andreas Stieger <[email protected]> +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. %bcond_without redis @@ -21,7 +31,7 @@ %bcond_without compression %bcond_without ssl Name: sipgrep -Version: 2.2.4 +Version: 2.2.5 Release: 0 Summary: Tool for displaying/troubleshooting SIP signaling on IP networks License: GPL-3.0-or-later ++++++ sipgrep-2.2.4.tar.gz -> sipgrep-2.2.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sipgrep-2.2.4/config.h new/sipgrep-2.2.5/config.h --- old/sipgrep-2.2.4/config.h 2026-08-22 23:45:23.000000000 +0200 +++ new/sipgrep-2.2.5/config.h 2026-11-12 22:59:07.000000000 +0100 @@ -121,7 +121,7 @@ #define PACKAGE_NAME "sipgrep" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "sipgrep 2.2.4" +#define PACKAGE_STRING "sipgrep 2.2.5" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "sipgrep" @@ -130,7 +130,7 @@ #define PACKAGE_URL "http://www.sipcapture.org" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2.2.4" +#define PACKAGE_VERSION "2.2.5" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -151,7 +151,7 @@ /* #undef USE_ZLIB */ /* Version number of package */ -#define VERSION "2.2.4" +#define VERSION "2.2.5" /* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>, <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sipgrep-2.2.4/configure new/sipgrep-2.2.5/configure --- old/sipgrep-2.2.4/configure 2026-08-22 23:45:23.000000000 +0200 +++ new/sipgrep-2.2.5/configure 2026-11-12 22:59:07.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sipgrep 2.2.4. +# Generated by GNU Autoconf 2.69 for sipgrep 2.2.5. # # Report bugs to <[email protected]>. # @@ -592,8 +592,8 @@ # Identity of this package. PACKAGE_NAME='sipgrep' PACKAGE_TARNAME='sipgrep' -PACKAGE_VERSION='2.2.4' -PACKAGE_STRING='sipgrep 2.2.4' +PACKAGE_VERSION='2.2.5' +PACKAGE_STRING='sipgrep 2.2.5' PACKAGE_BUGREPORT='[email protected]' PACKAGE_URL='http://www.sipcapture.org' @@ -1335,7 +1335,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sipgrep 2.2.4 to adapt to many kinds of systems. +\`configure' configures sipgrep 2.2.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1405,7 +1405,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sipgrep 2.2.4:";; + short | recursive ) echo "Configuration of sipgrep 2.2.5:";; esac cat <<\_ACEOF @@ -1513,7 +1513,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sipgrep configure 2.2.4 +sipgrep configure 2.2.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2068,7 +2068,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sipgrep $as_me 2.2.4, which was +It was created by sipgrep $as_me 2.2.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2885,7 +2885,7 @@ # Define the identity of the package. PACKAGE='sipgrep' - VERSION='2.2.4' + VERSION='2.2.5' cat >>confdefs.h <<_ACEOF @@ -14022,7 +14022,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sipgrep $as_me 2.2.4, which was +This file was extended by sipgrep $as_me 2.2.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14089,7 +14089,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sipgrep config.status 2.2.4 +sipgrep config.status 2.2.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sipgrep-2.2.4/configure.ac new/sipgrep-2.2.5/configure.ac --- old/sipgrep-2.2.4/configure.ac 2026-08-22 23:45:23.000000000 +0200 +++ new/sipgrep-2.2.5/configure.ac 2026-11-12 22:59:07.000000000 +0100 @@ -1,5 +1,5 @@ AC_PREREQ(2.61) -AC_INIT(sipgrep,2.2.4,[email protected],,[http://www.sipcapture.org]) +AC_INIT(sipgrep,2.2.5,[email protected],,[http://www.sipcapture.org]) AC_COPYRIGHT("SIP Capture Solution") AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE(foreign tar-ustar) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sipgrep-2.2.4/pkg/deb/debian/changelog new/sipgrep-2.2.5/pkg/deb/debian/changelog --- old/sipgrep-2.2.4/pkg/deb/debian/changelog 2026-08-22 23:45:23.000000000 +0200 +++ new/sipgrep-2.2.5/pkg/deb/debian/changelog 2026-11-12 22:59:07.000000000 +0100 @@ -1,3 +1,10 @@ +sipgrep (2.2.5) UNRELEASED; urgency=medium + + * Reject IPv4 fragments whose total length is shorter than the header. + * Ignore a negative Content-Length instead of using it as a buffer length. + + -- Alexandr Dubovikov <[email protected]> Thu, 12 Nov 2026 22:58:16 +0100 + sipgrep (2.2.4) UNRELEASED; urgency=medium * Fix off-by-one in regex_and() so combined -f/-t/-c filters keep the trailing parenthesis. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sipgrep-2.2.4/src/ipreasm.c new/sipgrep-2.2.5/src/ipreasm.c --- old/sipgrep-2.2.4/src/ipreasm.c 2026-08-22 23:45:23.000000000 +0200 +++ new/sipgrep-2.2.5/src/ipreasm.c 2026-11-12 22:59:07.000000000 +0100 @@ -325,6 +325,12 @@ if (!last_frag && (frag->len & 7) != 0) return false; + /* ip_len shorter than the header wraps .len to a huge unsigned value. + * offset + that length then wraps entry->len to 0 and the "extends past + * end" check below never fires. */ + if (frag->offset > ~frag->len) + return false; + if (entry->len != 0 && frag->len + frag->offset > entry->len) return false; /* fragment extends past end of packet */ @@ -423,6 +429,8 @@ assemble (struct reasm_ip_entry *entry, unsigned *output_len) { struct reasm_frag_entry *frag = entry->frags->next; /* skip list head */ + if (frag == NULL) + return NULL; unsigned offset0 = frag->data_offset; unsigned char *p = malloc (entry->len + offset0); if (p == NULL) @@ -449,6 +457,10 @@ /* join all the payload fragments together */ while (frag != NULL) { + if (frag->offset > entry->len || frag->len > entry->len - frag->offset) { + free (p); + return NULL; + } memcpy (p + offset0 + frag->offset, frag->data + frag->data_offset, frag->len); frag = frag->next; } @@ -669,6 +681,9 @@ static struct reasm_frag_entry * parse_packet (unsigned char *packet, unsigned len, enum reasm_proto *protocol, union reasm_id *id, unsigned *hash, bool *last_frag) { + if (len < 20) + return NULL; + struct ip *ip_header = (struct ip *) packet; struct reasm_frag_entry *frag = NULL; @@ -676,15 +691,22 @@ case 4: { *protocol = PROTO_IPV4; uint16_t offset = ntohs (ip_header->ip_off); - if (len >= ntohs (ip_header->ip_len) && (offset & (IP_MF | IP_OFFMASK)) != 0) { + unsigned ihl = (unsigned) ip_header->ip_hl * 4; + unsigned ip_len = ntohs (ip_header->ip_len); + /* An IPv4 header is at least 20 bytes, must fit in the captured + * data, and ip_len must cover the header. Without the last check + * the unsigned subtraction below wraps and reassembly copies an + * attacker-chosen number of bytes past a tiny buffer. */ + if (ihl >= 20 && ihl <= len && ip_len >= ihl && len >= ip_len && + (offset & (IP_MF | IP_OFFMASK)) != 0) { frag = malloc (sizeof (*frag)); if (frag == NULL) abort (); *frag = (struct reasm_frag_entry) { - .len = ntohs (ip_header->ip_len) - ip_header->ip_hl * 4, + .len = ip_len - ihl, .offset = (offset & IP_OFFMASK) * 8, - .data_offset = ip_header->ip_hl * 4, + .data_offset = ihl, .data = packet, }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sipgrep-2.2.4/src/sipparse.c new/sipgrep-2.2.5/src/sipparse.c --- old/sipgrep-2.2.4/src/sipparse.c 2026-08-22 23:45:23.000000000 +0200 +++ new/sipgrep-2.2.5/src/sipparse.c 2026-11-12 22:59:07.000000000 +0100 @@ -320,6 +320,14 @@ offset4 = sizeof (contentLengthStr) - 1; memcpy (contentLengthStr, tmp + 16, (size_t) offset4); contentLength = atoi (contentLengthStr); + /* atoi() accepts a leading '-'. The comparison below is signed, so a + * negative length passes and wraps when stored in *bytes_parsed. + * Treat it as a missing header and keep the parsed length inside + * this buffer. */ + if (contentLength < 0) { + contentLength = 0; + contentLengthFound = 0; + } } } } @@ -354,6 +362,12 @@ *bytes_parsed = blen; } + /* A wrapped length is larger than either buffer. Never report it. */ + if (packet_len == 0 && *bytes_parsed > blen) + *bytes_parsed = blen; + else if (*bytes_parsed > new_len) + *bytes_parsed = new_len; + return message_parsed; } @@ -363,6 +377,7 @@ unsigned int new_len = blen; int header_offset = 0; int content_length = 0; + int content_length_bad = 0; if (blen <= 2) return 0; @@ -383,7 +398,15 @@ /* BODY */ if((offset - last_offset) == 2) { - new_len = offset + content_length; + /* A negative Content-Length wraps when stored in + * *bytes_parsed. A value past this buffer would make + * the caller read off the end of the packet. */ + if (content_length_bad || offset < 0 + || (unsigned) offset > blen + || (unsigned) content_length > blen - (unsigned) offset) + new_len = blen; + else + new_len = (unsigned) offset + (unsigned) content_length; *bytes_parsed = new_len; break; } @@ -393,6 +416,10 @@ if(*(tmp+1) == ':') header_offset = 1; else header_offset = CONTENTLENGTH_LEN; content_length = atoi(tmp+header_offset+1); + if (content_length < 0) { + content_length = 0; + content_length_bad = 1; + } continue; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sipgrep-2.2.4/src/test_ipreasm_bounds.c new/sipgrep-2.2.5/src/test_ipreasm_bounds.c --- old/sipgrep-2.2.4/src/test_ipreasm_bounds.c 1970-01-01 01:00:00.000000000 +0100 +++ new/sipgrep-2.2.5/src/test_ipreasm_bounds.c 2026-11-12 22:59:07.000000000 +0100 @@ -0,0 +1,115 @@ +/* + * Regression tests for IPv4 fragment lengths in the reassembler. + * Build (from src/): + * gcc -fsanitize=address,undefined -O1 -g -I. \ + * -o test_ipreasm_bounds test_ipreasm_bounds.c ipreasm.c + */ + +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <arpa/inet.h> +#include <netinet/ip.h> +#include "include/ipreasm.h" + +static int failures = 0; + +static void +expect (int ok, const char *msg) +{ + if (!ok) { + fprintf (stderr, "FAIL: %s\n", msg); + failures++; + } +} + +/* ip_len is the value stored in the header, which may be shorter than the + * bytes we actually allocate. payload is the number of bytes after a + * 20-byte header present in the buffer. */ +static unsigned char * +make_frag (unsigned ip_len, unsigned ip_off, unsigned ip_id, + unsigned payload, unsigned char fill, unsigned *out_len) +{ + unsigned total = 20 + payload; + unsigned char *p = calloc (1, total); + struct ip *ip = (struct ip *) p; + + ip->ip_v = 4; + ip->ip_hl = 5; + ip->ip_len = htons (ip_len); + ip->ip_id = htons (ip_id); + ip->ip_off = htons (ip_off); + ip->ip_ttl = 64; + ip->ip_p = IPPROTO_UDP; + ip->ip_src.s_addr = htonl (0x0a000001); + ip->ip_dst.s_addr = htonl (0x0a000002); + if (payload) + memset (p + 20, fill, payload); + *out_len = total; + return p; +} + +static void +free_if_returned (unsigned char *in, unsigned char *out) +{ + if (out == NULL) + return; + free (out == in ? in : out); +} + +int +main (void) +{ + struct reasm_ip *reasm; + unsigned char *bad, *first, *last, *out; + unsigned bad_len, first_len, last_len, out_len; + const reasm_time_t ts = 1000; + + expect (sizeof (struct ip) == 20, "IPv4 header is 20 bytes"); + + /* Legitimate 8 + 8 byte reassembly still produces one packet. */ + reasm = reasm_ip_new (); + reasm_ip_set_timeout (reasm, 1000000); + first = make_frag (28, IP_MF, 1, 8, 'A', &first_len); + out = reasm_ip_next (reasm, first, first_len, ts, &out_len); + expect (out == NULL, "first fragment waits"); + last = make_frag (28, 1, 1, 8, 'B', &last_len); + out = reasm_ip_next (reasm, last, last_len, ts, &out_len); + expect (out != NULL && out != last, "two fragments reassemble"); + expect (out_len == 36, "reassembled length is header + 16"); + if (out != NULL && out_len >= 36) { + expect (memcmp (out + 20, "AAAAAAAABBBBBBBB", 16) == 0, "reassembled payload"); + free (out); + } + reasm_ip_free (reasm); + + /* ip_len shorter than the header must not be reassembled with a neighbour. */ + reasm = reasm_ip_new (); + reasm_ip_set_timeout (reasm, 1000000); + bad = make_frag (12, 1, 2, 0, 0, &bad_len); + out_len = 0; + out = reasm_ip_next (reasm, bad, bad_len, ts, &out_len); + expect (out == bad, "short ip_len is not a fragment"); + expect (out_len == bad_len, "short ip_len keeps the captured length"); + free_if_returned (bad, out); + + first = make_frag (28, IP_MF, 2, 8, 'A', &first_len); + out = reasm_ip_next (reasm, first, first_len, ts, &out_len); + expect (out == NULL, "valid fragment after a short ip_len waits"); + last = make_frag (28, 1, 2, 8, 'B', &last_len); + out = reasm_ip_next (reasm, last, last_len, ts, &out_len); + expect (out != NULL && out != last, "valid pair still reassembles"); + expect (out_len == 36, "valid pair length"); + if (out != NULL && out_len >= 36) { + expect (memcmp (out + 20, "AAAAAAAABBBBBBBB", 16) == 0, "valid pair payload"); + free (out); + } + reasm_ip_free (reasm); + + if (failures) { + fprintf (stderr, "%d failure(s)\n", failures); + return 1; + } + printf ("ok\n"); + return 0; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sipgrep-2.2.4/src/test_sipparse_bounds.c new/sipgrep-2.2.5/src/test_sipparse_bounds.c --- old/sipgrep-2.2.4/src/test_sipparse_bounds.c 2026-08-22 23:45:23.000000000 +0200 +++ new/sipgrep-2.2.5/src/test_sipparse_bounds.c 2026-11-12 22:59:07.000000000 +0100 @@ -21,13 +21,14 @@ } } -static void +static unsigned parse_buf (const char *msg, struct preparsed_sip *psip) { unsigned int bytes_parsed = 0; memset (psip, 0, sizeof (*psip)); parse_message ((unsigned char *) msg, (unsigned int) strlen (msg), &bytes_parsed, psip); + return bytes_parsed; } int @@ -80,6 +81,54 @@ expect (strcmp (psip.reason, "OK") == 0, "long Content-Length: reason OK"); expect (psip.callid.s != NULL && psip.callid.len > 0, "long Content-Length: callid intact"); + /* Negative Content-Length must not be reported as a huge parsed length. */ + { + const char *neg = + "INVITE sip:a@b SIP/2.0\r\n" + "Call-ID: abc-123\r\n" + "CSeq: 1 INVITE\r\n" + "Content-Length: -99\r\n" + "\r\n" + "BODY"; + unsigned parsed = parse_buf (neg, &psip); + + expect (parsed > 0 && parsed <= strlen (neg), "negative Content-Length: stays inside the buffer"); + expect (parsed == strlen (neg), "negative Content-Length: consumes this buffer"); + expect (psip.is_method == SIP_REQUEST, "negative Content-Length: still a request"); + } + + /* -m uses light_parse_message(); same negative length, same bound. */ + { + const char *neg = + "INVITE sip:a@b SIP/2.0\r\n" + "Content-Length: -99\r\n" + "\r\n" + "BODY"; + unsigned int parsed = 0; + + expect (light_parse_message ((char *) neg, (unsigned int) strlen (neg), &parsed) == 1, + "light: negative Content-Length parses"); + expect (parsed == strlen (neg), "light: negative Content-Length consumes this buffer"); + } + + /* A positive Content-Length still splits a following message. */ + { + const char *two = + "INVITE sip:a@b SIP/2.0\r\n" + "Content-Length: 4\r\n" + "\r\n" + "BODY" + "INVITE sip:c@d SIP/2.0\r\n"; + const char *split = strstr (two, "\r\n\r\n"); + unsigned int parsed = 0; + unsigned expect_n = (unsigned) (split - two) + 4 + 4; + + expect (split != NULL, "light: fixture has a header break"); + expect (light_parse_message ((char *) two, (unsigned int) strlen (two), &parsed) == 1, + "light: positive Content-Length parses"); + expect (parsed == expect_n, "light: positive Content-Length keeps the body length"); + } + if (failures) { fprintf (stderr, "%d failure(s)\n", failures); return 1;
