From nobody Tue Nov 17 17:09:54 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jTWSL53h4z71Sg2 for ; Tue, 17 Nov 2026 17:09:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jTWSL2Tz6z4QX3 for ; Tue, 17 Nov 2026 17:09:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794935394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E9kP6YFL6U4KyEewBxU7P6gqAt0qogMX7Lbkw+oyPhY=; b=xmkSwvhI7J2wIzRKmSZq93hu4H7Zj6pKLPi60RZhGqXkKVVciNWlHZ8M0PnjCLSBSx6gHO o4QGmGCC791l3CO74sE9qxQ9Gwk8scoCQuNAd4ZAitu92RoB0WmpXMKm1XbbMmEj76kVYH Ooa6zZWVz/MV0C5P0WPvtdYjPaof/s27fglSFfobBWjsuNkeH5kjIDqSmuMWULec+xBmYS I3KeBocm66KoQFQVMKLwV3xp8zgqUvIaw1EmCUIcUWFSP66k3hmT+tMmkDGSyGYKakWEqB /NTWwPtcT1DjsPuWw0pyOtK5GzJjkAvXYRrhTcQYYeQkFqhNzUhc11YRCgN5RQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794935394; b=aoAua/skiAVaIjfPe0eSZnose+petNgI9TBQvUkNB2T8wxihWfR3D0i/yE9Smmw75Nd9uB ljUsre9cVozQPNaIsgmHVRbHzRlYpffghjyKqJFO//tAcfjIWXlWK8yvBabqhA03/bTKI2 g9swzYYOsWA3MOCmm25HtaVs+wh4pgmbcRS+lNp6a8aBuQSsmPzUkZGLPns/nVLh3aiJ9a Uwjt7God7XQk/5vneJhUgIb7yGb058YJzS9eO/SQElOmWx0uYDF96YXzLQ1ryOMC5BsRSR KqwBmP/ZSbzWlQ46QTtRUEL02u7Uop+5wVbEzew+so2PEpzU6JSOMYqVMuQQ9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794935394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E9kP6YFL6U4KyEewBxU7P6gqAt0qogMX7Lbkw+oyPhY=; b=cXp1F5dSvS7Ni38AEclWNP2ghRhdHjtSHdKGqVL0jogaDhdQikMWn+mj6p11ZMi5CZftNQ Swc22yD/kLSoNfbgriyqqv/MY7jltIcNhxe3uijXtyqUFL7leDtY6ym1WQsQHn4UVVe5HI ptEuQoKpvvJVGfF05i4JVA2l2u8hB8tpb6Y3yVLovQOVIyBK870zxAaPnsimunyOce2Eas UT8eGUHTupDfAHHoVwcAgh9DxCCs1u1lomeJEjtq+BDaHYM+VuagqLFutNSYbSFLobFM5I bZ3dSwcO89qBYFcSy1RqL46CF/H1TBLYT3VHWhB+m+lHGogK9o8qUfT5Fc7TVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jTWSL1p6pzrkf for ; Tue, 17 Nov 2026 17:09:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 992 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 17 Nov 2026 17:09:54 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Maxim Konovalov From: Mark Johnston Subject: git: 43810781d950 - releng/15.2 - bsnmp: let an SNMPv3 discovery message elicit only a Report List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.2 X-Git-Reftype: branch X-Git-Commit: 43810781d950d742d989b796c6d15ea8133bab26 Auto-Submitted: auto-generated Date: Tue, 17 Nov 2026 17:09:54 +0000 Message-Id: <6afc8a62.992.3521d571@gitrepo.freebsd.org> The branch releng/15.2 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=43810781d950d742d989b796c6d15ea8133bab26 commit 43810781d950d742d989b796c6d15ea8133bab26 Author: Maxim Konovalov AuthorDate: 2026-11-12 00:43:06 +0000 Commit: Mark Johnston CommitDate: 2026-11-17 13:36:30 +0000 bsnmp: let an SNMPv3 discovery message elicit only a Report An SNMPv3 message with no variable bindings is treated as RFC 3414 engineID (or time-window) discovery: snmp_input_start() appends a single usmStats counter to the request, and snmp_pdu_auth_access() skips the VACM check because the AUTODISCOVER flag is set. The request's verb was then still dispatched by type. A genuine discovery is a GET and simply reads that counter back -- the intended Report -- but a zero-binding GETNEXT or GETBULK instead walks forward from the appended OID, and with VACM skipped it returns the next registered object(s): an unauthenticated read of the agent's USM and VACM configuration (objects at or after 1.3.6.1.6.3.15). Force the verb of a discovery message to GET, so the appended counter is read as-is and no walk (or SET) can run under the skipped-VACM state. Genuine discovery, which already uses GET, is unaffected. This complements the earlier change that rejects an AUTODISCOVER message carrying its own bindings; that guard is never reached on this path, because the offending binding is appended by the agent after the zero-binding test. Approved by: re (cperciva) Approved by: so Security: FreeBSD-SA-26:89.bsnmp Reviewed by: harti Fixes: 135f7de5ddb6 --- contrib/bsnmp/snmpd/main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/contrib/bsnmp/snmpd/main.c b/contrib/bsnmp/snmpd/main.c index add9ec680eb1..526fbb38b8f8 100644 --- a/contrib/bsnmp/snmpd/main.c +++ b/contrib/bsnmp/snmpd/main.c @@ -644,6 +644,15 @@ decoded: pdu->engine.engine_boots = snmpd_engine.engine_boots; pdu->engine.engine_time = snmpd_engine.engine_time; } + /* + * A discovery message may only elicit a Report. Force GET + * so the appended usmStats counter is read back as-is: a + * GETNEXT or GETBULK would otherwise walk forward from it, + * and a SET act on it, all with VACM skipped for the + * AUTODISCOVER flag. + */ + if ((pdu->flags & SNMP_MSG_AUTODISCOVER) != 0) + pdu->type = SNMP_PDU_GET; } else if (pdu->user.auth_proto != SNMP_AUTH_NOAUTH && (pdu->engine.engine_boots == 0 || pdu->engine.engine_time == 0)) { snmpd_usmstats.not_in_time_windows++;