REDHAT-BUG-2277202: Buffer Overflow

Published Apr 25, 2024
·
Updated

A stack-based buffer overflow in nscd was reported and assigned CVE-2024-33599.

Reference: https://sourceware.org/bugzilla/showbug.cgi?id=31677

---

nscd/netgroupcache.c (addinnetgrX):

497 struct indataset 498 { 499 struct datahead head; 500 innetgroupresponseheader resp; 501 } dataset 502 = (struct indataset ) mempoolalloc (db, 503 sizeof (dataset) + req->keylen, 504 1);

mempoolalloc fails and returns NULL.

This is possible if posixfallocate fails and the retry fails.

505 struct indataset datasetmem; 506 bool cacheable = true; 507 if (glibcunlikely (dataset == NULL)) 508 { 509 cacheable = false; 510 dataset = &datasetmem;

This structure has no room for req->keylen material.

511 } 512 513 dataheadinitpos (&dataset->head, sizeof (dataset) + req->keylen, 514 sizeof (innetgroupresponseheader), 515 he == NULL ? 0 : dh->nreloads + 1, result->head.ttl); 516 / Set the notfound status and timeout based on the result from 517 getnetgrent. / 518 dataset->head.notfound = result->head.notfound; 519 dataset->head.timeout = timeout; 520 521 dataset->resp.version = NSCDVERSION; 522 dataset->resp.found = result->resp.found; 523 / Until we find a matching entry the result is 0. / 524 dataset->resp.result = 0; 525 526 char keycopy = memcpy ((char ) (dataset + 1), group, req->keylen);

This copies up to req->keylen material to a structure that has no storage space for it.

This was detected by static code analysis.

It will only happen in the case the database runs out of memory/storage while expanding the netgroup cache.

The group entries overwrite other data on the stack after datasetmem.

The workaround is not to cache the netgroup if this is impacting the use of the application.

Affected Software

1 affected component
GNU glibc nscd

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Configuration

    Apply the stated workaround: do not cache the netgroup when the issue is impacting the application (set cacheable to false / disable netgroup caching as a workaround for CVE-2024-33599).

    nscd (netgroup cache in nscd/netgroupcache.c, addinnetgrX) netgroup cache caching behavior (cacheable) = false

Event History

Apr 25, 2024
Data Sourced
via Red Hat·05:24 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of REDHAT-BUG-2277202?

REDHAT-BUG-2277202 has been classified as a critical vulnerability due to its potential for a stack-based buffer overflow.

2

How do I fix REDHAT-BUG-2277202?

To fix REDHAT-BUG-2277202, update your GNU nscd package to the latest version provided by your distribution.

3

What systems are affected by REDHAT-BUG-2277202?

REDHAT-BUG-2277202 affects systems running GNU nscd with specific versions that have the vulnerability.

4

What type of vulnerability is REDHAT-BUG-2277202?

REDHAT-BUG-2277202 is categorized as a stack-based buffer overflow vulnerability.

5

Is there a known exploit for REDHAT-BUG-2277202?

As of now, there are no public details regarding known exploits specifically targeting REDHAT-BUG-2277202.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203