diff options
| author | Rich Felker <dalias@aerifal.cx> | 2026-03-17 21:59:45 -0400 |
|---|---|---|
| committer | Rich Felker <dalias@aerifal.cx> | 2026-03-19 09:57:35 -0400 |
| commit | 149d872970312e56a3052f51708b1da2c78ef641 (patch) | |
| tree | fd957f9fee1ba13d474315cf74401b0905def5fd /src/string/index.c | |
| parent | 19f9aeaaba1bde5b541b7758cbf661ba29fb9cea (diff) | |
| download | musl-149d872970312e56a3052f51708b1da2c78ef641.tar.gz | |
getgr*: validate group member lists from nscd backend
this corrects missing validation when using alternate group database
backends via nscd, as reported by 0rbitingZer0, which could result in
a heap-based buffer overflow.
while the source of truth for user (passwd) and group definitions is
generally an equal or higher-privilege domain than the application,
and compromise of nscd could inherently lead to bypass of some access
controls, it is still worthwhile to harden against direct attacks from
a compromised nscd.
this patch adds validation in the least invasive way possible,
erroring out at the point where a write past the end of the buffer
would previously have occurred.
a check is also added for member counts that would cause arithmetic
overflow in the existing buffer size computations, including negative
counts. this could be handled better by making adjustments where the
arithmetic is performed, but the way it's done here avoids making any
changes except for the actual bounds check.
Diffstat (limited to 'src/string/index.c')
0 files changed, 0 insertions, 0 deletions
