tianon / gosu

Simple Go-based setuid+setgid+setgroups+exec
Apache License 2.0
4.72k stars 320 forks source link

Add new "govulncheck-with-excludes.sh" wrapper script #129

Closed tianon closed 1 year ago

tianon commented 1 year ago

This allows us to exclude GO-2023-1840 (aka CVE-2023-29403; https://github.com/tianon/gosu/issues/128#issuecomment-1607803883) from our report since we already refuse to operate when users have enabled the setuid bit on the binary.

Additionally, this updates our in-code check for setuid to also disallow setgid, but the impact of that configuration is lesser (so this is considered a best-effort pre-emptive mitigation -- hopefully the block on setuid has already discouraged users from using gosu in this way).

(This is essentially a workaround for https://github.com/golang/go/issues/59507, which isn't ideal, but it's the best we have for now.)