mirror of https://git.musl-libc.org/git/musl
Browse Source
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.master
1 changed files with 11 additions and 1 deletions
Loading…
Reference in new issue