An issue was discovered in Squid through 4.7. When Squid is parsing ESI, it keeps the ESI elements in ESIContext. ESIContext contains a buffer for holding a stack of ESIElements. When a new ESIElement is parsed, it is added via addStackElement. addStackElement has a check for the number of elements in this buffer, but it's off by 1, leading to a Heap Overflow of 1 element. The overflow is within the same structure so it can't affect adjacent memory blocks, and thus just leads to a crash while processing.
{
"unresolved_ranges": [
{
"source": "CPE_FIELD",
"cpes": [
"cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:lts:*:*:*",
"cpe:2.3:o:canonical:ubuntu_linux:18.04:*:*:*:lts:*:*:*",
"cpe:2.3:o:canonical:ubuntu_linux:19.10:*:*:*:*:*:*:*",
"cpe:2.3:o:canonical:ubuntu_linux:20.04:*:*:*:lts:*:*:*"
],
"extracted_events": [
{
"last_affected": "16.04"
},
{
"last_affected": "18.04"
},
{
"last_affected": "19.10"
},
{
"last_affected": "20.04"
}
],
"vendor_product": "canonical:ubuntu_linux"
},
{
"extracted_events": [
{
"last_affected": "9.0"
},
{
"last_affected": "10.0"
}
],
"cpes": [
"cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*",
"cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*"
],
"source": "CPE_FIELD",
"vendor_product": "debian:debian_linux"
},
{
"extracted_events": [
{
"last_affected": "15.1"
}
],
"cpes": [
"cpe:2.3:o:opensuse:leap:15.1:*:*:*:*:*:*:*"
],
"source": "CPE_FIELD",
"vendor_product": "opensuse:leap"
}
]
}{
"source": "CPE_FIELD",
"extracted_events": [
{
"introduced": "3.0"
},
{
"last_affected": "3.5.28"
},
{
"introduced": "4.0"
},
{
"last_affected": "4.7"
},
{
"introduced": "5.0"
},
{
"last_affected": "5.0.1"
}
],
"cpe": "cpe:2.3:a:squid-cache:squid:*:*:*:*:*:*:*:*"
}