cmd/fsu: check uid range before syscall
This limits potential exploits to the fortify uid range. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
parent
c2b178e626
commit
b453f70ca2
@ -123,6 +123,11 @@ func main() {
|
|||||||
suppGroups = []int{uid}
|
suppGroups = []int{uid}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// final bounds check to catch any bugs
|
||||||
|
if uid < 1000000 || uid >= 2000000 {
|
||||||
|
panic("uid out of bounds")
|
||||||
|
}
|
||||||
|
|
||||||
// careful! users in the allowlist is effectively allowed to drop groups via fsu
|
// careful! users in the allowlist is effectively allowed to drop groups via fsu
|
||||||
|
|
||||||
if err := syscall.Setresgid(uid, uid, uid); err != nil {
|
if err := syscall.Setresgid(uid, uid, uid); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user