package/netsnmp: add patch for CVE-2025-68615

Fixes the following security vulnerability:

- CVE-2025-68615:
    net-snmp is a SNMP application library, tools and daemon. Prior to
    versions 5.9.5 and 5.10.pre2, a specially crafted packet to an net-
    snmp snmptrapd daemon can cause a buffer overflow and the daemon to
    crash. This issue has been patched in versions 5.9.5 and 5.10.pre2.

For more information, see:
  - https://www.cve.org/CVERecord?id=CVE-2025-68615
  - b4e6f826d9

Signed-off-by: Thomas Perale <thomas.perale@mind.be>
Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
Thomas Perale
2026-02-22 21:34:23 +01:00
committed by Julien Olivain
parent 39b2b6e4a3
commit d51117ccde
2 changed files with 34 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
From b4e6f826d9ddcc2d72eac432746807e1234266db Mon Sep 17 00:00:00 2001
From: Bart Van Assche <bvanassche@acm.org>
Date: Sun, 2 Nov 2025 14:48:55 -0800
Subject: [PATCH] snmptrapd: Fix out-of-bounds trapOid[] accesses
Fixes: https://issues.oss-fuzz.com/issues/457106694
Fixes: https://issues.oss-fuzz.com/issues/458668421
Fixes: https://issues.oss-fuzz.com/issues/458876071
CVE: CVE-2025-68615
Upstream: https://github.com/net-snmp/net-snmp/commit/b4e6f826d9ddcc2d72eac432746807e1234266db
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
---
apps/snmptrapd_handlers.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/apps/snmptrapd_handlers.c b/apps/snmptrapd_handlers.c
index 6cd126f266..afd93ed0fb 100644
--- a/apps/snmptrapd_handlers.c
+++ b/apps/snmptrapd_handlers.c
@@ -1112,6 +1112,12 @@ snmp_input(int op, netsnmp_session *session,
*/
if (pdu->trap_type == SNMP_TRAP_ENTERPRISESPECIFIC) {
trapOidLen = pdu->enterprise_length;
+ /*
+ * Drop packets that would trigger an out-of-bounds trapOid[]
+ * access.
+ */
+ if (trapOidLen < 1 || trapOidLen > OID_LENGTH(trapOid) - 2)
+ return 1;
memcpy(trapOid, pdu->enterprise, sizeof(oid) * trapOidLen);
if (trapOid[trapOidLen - 1] != 0) {
trapOid[trapOidLen++] = 0;

View File

@@ -11,6 +11,8 @@ NETSNMP_LICENSE = Various BSD-like
NETSNMP_LICENSE_FILES = COPYING
NETSNMP_CPE_ID_VENDOR = net-snmp
NETSNMP_CPE_ID_PRODUCT = $(NETSNMP_CPE_ID_VENDOR)
# 0004-snmptrapd-Fix-out-of-bounds-trapOid-accesses.patch
NETSNMP_IGNORE_CVES += CVE-2025-68615
NETSNMP_SELINUX_MODULES = snmp
NETSNMP_INSTALL_STAGING = YES
NETSNMP_CONF_ENV = \