Am I affected?

type your snmp version to check

Description

Improper Validation of Specified Quantity in Input vulnerability in the BER decoder in Erlang/OTP snmp allows an unauthenticated remote attacker to exhaust CPU via an SNMP message that contains an OBJECT IDENTIFIER with a very long sub-identifier.

snmp_pdus:dec_oid_element/3 does not limit the number of base-128 octets in a sub-identifier, and snmp_pdus:dec_oid_elements/3 does not limit the number of sub-identifiers, so one sub-identifier can span the whole datagram. When the value exceeds the native integer size, each further octet copies a growing bignum, and decoding time grows quadratically with the sub-identifier length. The agent and the manager decode OIDs before they check community strings or SNMPv3 credentials, inside the single network interface process (snmpa_net_if or snmpm_net_if). That process does not read the next datagram until decoding completes.

This issue affects OTP from OTP 17.0 before OTP 27.3.4.20, OTP 28.5.0.9, and OTP 29.1.3, corresponding to snmp from 4.25.1 before 5.18.2.3, 5.20.2.4, and 5.20.7. Whether OTP before OTP 17.0, corresponding to snmp before 4.25.1, is affected is unknown.

Weaknesses & attack patterns

Weakness

CWE-1284 · Improper Validation of Specified Quantity in Input in catalog → MITRE ↗
CWE-770 · Allocation of Resources Without Limits or Throttling in catalog → MITRE ↗

Attack patterns

CAPEC-231 · Oversized Serialized Data Payloads MITRE ↗

An unauthenticated remote attacker who can send UDP datagrams to an SNMP agent or manager can keep its network interface process busy with a low rate of crafted messages. The agent or manager then stops processing legitimate SNMP traffic while the attack continues.

Affected — Erlang / snmp Repository ↗

≥ 4.25.1 and up affected
→ 5.18.2.3 not affected
→ 5.20.2.4 not affected
→ 5.20.7 not affected
every other version: unknown
cpe cpe:2.3:a:erlang:erlang/otp:*:*:*:*:*:*:*:*
version type otp
modules · source files · routines
modules snmp_pdus
source files src/misc/snmp_pdus.erl
routines snmp_pdus:dec_oid_element/3 · snmp_pdus:dec_oid_elements/3 · snmp_pdus:dec_oid_notag/1 · snmp_pdus:dec_pdu/1 · snmp_pdus:dec_scoped_pdu/1 · snmp_pdus:dec_message/1

Affected — Erlang

≥ 17.0 and up affected
→ 27.3.4.20 not affected
→ 28.5.0.9 not affected
→ 29.1.3 not affected
every other version: unknown
cpe cpe:2.3:a:erlang:erlang/otp:*:*:*:*:*:*:*:*
version type otp
modules · source files · routines
modules snmp_pdus
source files lib/snmp/src/misc/snmp_pdus.erl
routines snmp_pdus:dec_oid_element/3 · snmp_pdus:dec_oid_elements/3 · snmp_pdus:dec_oid_notag/1 · snmp_pdus:dec_pdu/1 · snmp_pdus:dec_scoped_pdu/1 · snmp_pdus:dec_message/1

Affected — GitHub / erlang/otp Repository ↗

≥ 84adefa and up affected
→ 6f8c104 not affected
→ 8c5cd9b not affected
→ a1bfce6 not affected
≥ 6f8c104 and up not affected
≥ 8c5cd9b and up not affected
≥ a1bfce6 and up not affected
every other version: unknown
cpe cpe:2.3:a:erlang:erlang/otp:*:*:*:*:*:*:*:*
version type git
modules · source files · routines
modules snmp_pdus
source files lib/snmp/src/misc/snmp_pdus.erl
routines snmp_pdus:dec_oid_element/3 · snmp_pdus:dec_oid_elements/3 · snmp_pdus:dec_oid_notag/1 · snmp_pdus:dec_pdu/1 · snmp_pdus:dec_scoped_pdu/1 · snmp_pdus:dec_message/1

Workarounds

Restrict network access to the SNMP agent and manager UDP ports to trusted management hosts only, using firewall rules or by binding the agent to a dedicated management interface. Disable SNMPv1 and SNMPv2c in the agent if they are not needed. This reduces, but does not eliminate, the exposure, since SNMPv3 discovery messages are still decoded before authentication.

Note that community strings and SNMPv3 credentials do not mitigate this issue, since decoding happens before they are checked.

References

Credits

Lukas Backström Finder
Konrad Pietrzak Reporter Remediation developer
Ingela Anderton Andin Coordinator
Jonatan Männchen / EEF Coordinator

CVSS breakdown

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Exploitability

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None

Vulnerable System

Confidentiality
None
Integrity
None
Availability
High

Subsequent Systems

Confidentiality
None
Integrity
None
Availability
None
« All CVEs