]> git.ipfire.org Git - thirdparty/cups.git/commit
snmp.c: Validate input OID string for `_cupsSNMPStringToOID()` 907/head
authorZdenek Dohnal <zdohnal@redhat.com>
Mon, 18 Mar 2024 14:02:30 +0000 (15:02 +0100)
committerZdenek Dohnal <zdohnal@redhat.com>
Mon, 18 Mar 2024 14:02:30 +0000 (15:02 +0100)
commite5d4ed32a42140ef42055c1c73713590b10a59ab
tree559f6549f2ef1860db9ff608c03272d2f15564ff
parentf9f5f9f9a60f63df451fe9f59f75af4fc89b9736
snmp.c: Validate input OID string for `_cupsSNMPStringToOID()`

We can accept OID string as input in few cases (mainly via side channel)
and if the crafted OID string is sent, internal function
`asn1_size_oid()` can end up with stack buffer overflow.

The issue happens when one OID node is too large, or OID is invalid
(ending with dots) - we can fix it in `_cupsSNMPStringToOID()` by
checking if the last source character is a dot (invalid OID),
and by limiting integer for OID node to 0xffff.

Fixes #905
cups/snmp.c