Miggo Logo

CVE-2024-33599: nscd: Stack-based buffer overflow in netgroup cache If the Name Service Cache Daemon's (nscd)...

8.1

CVSS Score
3.1

Basic Information

EPSS Score
0.67862%
Published
5/6/2024
Updated
3/26/2025
KEV Status
No
Technology
-

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability description and the commit patch clearly point to a stack-based buffer overflow in the addinnetgrX function within nscd/netgroupcache.c. The patch modifies how memory is allocated when a cache allocation fails, specifically replacing a fixed-size stack buffer with alloca. This change directly addresses the overflow condition. The commit message explicitly mentions CVE-2024-33599 and the nature of the bug.

Initially, I tried to fetch content from sourceware.org but it was protected. I then used Google to search for the CVE and found a link to an Ubuntu security page which contained the commit hash 87801a8fd06db1d654eea3e4f7626ff476a9bdaa. I then used this hash to fetch commit information from a glibc mirror on GitHub (bminor/glibc). The commit details directly implicated the addinnetgrX function and provided the patch diff showing the vulnerable code and its fix. The vulnerability occurs when mempool_alloc fails and the code falls back to a fixed-size stack buffer dataset_mem, which could be overflowed if req->key_len is too large. The fix involves using alloca instead, with a comment indicating that key_len is checked elsewhere, making alloca safe in this context for the patched version, but highlighting the original flaw with the fixed-size buffer on the stack when the primary allocation failed.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

ns**: St**k-**s** *u***r ov*r*low in n*t*roup ***** I* t** N*m* S*rvi** ***** ***mon's (ns**) *ix** siz* ***** is *x**ust** *y *li*nt r*qu*sts t**n * su*s*qu*nt *li*nt r*qu*st *or n*t*roup **t* m*y r*sult in * st**k-**s** *u***r ov*r*low. T*is *l*w

Reasoning

T** vuln*r**ility **s*ription *n* t** *ommit p*t** *l**rly point to * st**k-**s** *u***r ov*r*low in t** `***inn*t*rX` *un*tion wit*in `ns**/n*t*roup*****.*`. T** p*t** mo*i*i*s *ow m*mory is *llo**t** w**n * ***** *llo**tion **ils, sp**i*i**lly r*pl