net-snmp 3.29.2 → 3.29.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +3 -0
- package/README.md +6 -0
- package/index.js +34 -2
- package/package.json +1 -1
package/CONTRIBUTING.md
CHANGED
|
@@ -15,6 +15,9 @@ requests](#pull-requests). Please prefer the issue tracker over
|
|
|
15
15
|
emailing individual project contributors as your first engagement
|
|
16
16
|
with the project.
|
|
17
17
|
|
|
18
|
+
Security vulnerabilities are the exception: please report them privately
|
|
19
|
+
as described in [SECURITY.md](SECURITY.md), not in the issue tracker.
|
|
20
|
+
|
|
18
21
|
## What to always do
|
|
19
22
|
|
|
20
23
|
1. Please respect the hundreds of hours developers have spent writing and testing
|
package/README.md
CHANGED
|
@@ -3816,6 +3816,12 @@ Example programs are included under the module's `example` directory.
|
|
|
3816
3816
|
|
|
3817
3817
|
* Reject a varbind list that ends with a truncated OID instead of looping forever - a short unauthenticated UDP packet whose varbind carried a lone OID tag with no length byte sent the varbind parser into an infinite loop, spinning the CPU at 100% or exhausting memory. Such packets are now rejected with a `ResponseInvalidError` carrying the new `EBadVarbindList` code, closing a network-reachable denial-of-service on agents, receivers, and session clients
|
|
3818
3818
|
|
|
3819
|
+
# Version 3.29.3 - 19/11/2026
|
|
3820
|
+
|
|
3821
|
+
* Reject SNMPv3 messages with an empty user name except for engine ID discovery - a message with a zero-length user name and no authentication was accepted by agents and receivers as if it came from a configured user, letting an unauthenticated sender read and write an agent's objects (under the default access control model), reach proxied devices, and inject traps and informs into a receiver (GHSA-pg9p-672x-44jc). Such messages are now treated as coming from an unknown user, as RFC 3414 requires. Applications that relied on empty user names being accepted can restore that with the `disableAuthorization` option
|
|
3822
|
+
|
|
3823
|
+
* Enforce the Simple access control model on requests forwarded to a proxy - a request carrying a proxy context name was forwarded without checking the requesting user's access level, so a read-only user could write to a proxied device (GHSA-jjpx-x4gm-m546). Requests the user is not allowed to make are now answered with `noAccess` and are not forwarded
|
|
3824
|
+
|
|
3819
3825
|
# License
|
|
3820
3826
|
|
|
3821
3827
|
Copyright (c) 2020 Mark Abrahams <mark@abrahams.co.nz>
|
package/index.js
CHANGED
|
@@ -1854,6 +1854,13 @@ Message.prototype.hasAuthoritativeEngineID = function () {
|
|
|
1854
1854
|
this.msgSecurityParameters.msgAuthoritativeEngineID != "";
|
|
1855
1855
|
};
|
|
1856
1856
|
|
|
1857
|
+
// An SNMPv3 engine ID discovery request (RFC 3414 section 4): a reportable
|
|
1858
|
+
// GetRequest that does not yet name the authoritative engine
|
|
1859
|
+
Message.prototype.isEngineDiscovery = function () {
|
|
1860
|
+
return this.version == Version3 && !! this.pdu && this.pdu.type == PduType.GetRequest &&
|
|
1861
|
+
! this.hasAuthoritativeEngineID () && !! this.isReportable ();
|
|
1862
|
+
};
|
|
1863
|
+
|
|
1857
1864
|
Message.prototype.createReportResponseMessage = function (engine, context, errorType) {
|
|
1858
1865
|
var user = {
|
|
1859
1866
|
name: "",
|
|
@@ -3330,6 +3337,18 @@ Listener.processIncoming = function (buffer, authorizer, callback) {
|
|
|
3330
3337
|
callback (new RequestFailedError ("Local user not found and message requires authentication with user " +
|
|
3331
3338
|
message.msgSecurityParameters.msgUserName));
|
|
3332
3339
|
return;
|
|
3340
|
+
} else if ( ! authorizer.disableAuthorization && ! message.isEngineDiscovery () ) {
|
|
3341
|
+
// RFC 3414 section 2.4: a zero-length userName does not match any
|
|
3342
|
+
// user, and may only be used for snmpEngineID discovery
|
|
3343
|
+
if ( message.isReportable () ) {
|
|
3344
|
+
return {
|
|
3345
|
+
original: message,
|
|
3346
|
+
report: true,
|
|
3347
|
+
errorType: UsmErrorType.UNKNOWN_USER_NAME
|
|
3348
|
+
};
|
|
3349
|
+
}
|
|
3350
|
+
callback (new RequestFailedError ("Local user not found for message with empty user name"));
|
|
3351
|
+
return;
|
|
3333
3352
|
} else {
|
|
3334
3353
|
message.user = {
|
|
3335
3354
|
name: "",
|
|
@@ -5254,8 +5273,7 @@ Agent.prototype.onMsg = function (socket, buffer, rinfo) {
|
|
|
5254
5273
|
}
|
|
5255
5274
|
|
|
5256
5275
|
// SNMPv3 discovery
|
|
5257
|
-
if ( message.
|
|
5258
|
-
! message.hasAuthoritativeEngineID() && message.isReportable () ) {
|
|
5276
|
+
if ( message.isEngineDiscovery () ) {
|
|
5259
5277
|
let reportMessage = message.createReportResponseMessage (this.engine, this.context, UsmErrorType.UNKNOWN_ENGINE_ID);
|
|
5260
5278
|
this.listener.send (reportMessage, rinfo, socket);
|
|
5261
5279
|
return;
|
|
@@ -5984,6 +6002,20 @@ Agent.prototype.onProxyRequest = function (socket, message, rinfo) {
|
|
|
5984
6002
|
this.callback (new RequestFailedError ("No proxy found for message received with context " + contextName));
|
|
5985
6003
|
return;
|
|
5986
6004
|
}
|
|
6005
|
+
// The proxied request is sent with the proxy's own credentials, so the
|
|
6006
|
+
// requesting user's access level must be enforced here before forwarding
|
|
6007
|
+
if ( ! this.authorizer.isAccessAllowed (message.version, message.user.name, message.pdu.type) ) {
|
|
6008
|
+
var responsePdu = message.pdu.getResponsePduForRequest ();
|
|
6009
|
+
responsePdu.varbinds = message.pdu.varbinds.map (varbind => ({
|
|
6010
|
+
oid: varbind.oid,
|
|
6011
|
+
type: ObjectType.Null,
|
|
6012
|
+
value: null
|
|
6013
|
+
}));
|
|
6014
|
+
responsePdu.errorStatus = ErrorStatus.NoAccess;
|
|
6015
|
+
responsePdu.errorIndex = 1;
|
|
6016
|
+
this.sendResponse (socket, rinfo, message, responsePdu);
|
|
6017
|
+
return;
|
|
6018
|
+
}
|
|
5987
6019
|
if ( ! proxy.session.msgSecurityParameters ) {
|
|
5988
6020
|
// Discovery required - but chaining not implemented from here yet
|
|
5989
6021
|
proxy.session.sendV3Discovery (null, null, this.callback, {});
|