Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gosu carries many CVE and appears unused #401

Open
jrwren opened this issue May 29, 2024 · 5 comments · May be fixed by #402
Open

gosu carries many CVE and appears unused #401

jrwren opened this issue May 29, 2024 · 5 comments · May be fixed by #402

Comments

@jrwren
Copy link

jrwren commented May 29, 2024

Would you be open to a patch which removes the unused gosu?

@yosifkit
Copy link
Contributor

  1. gosu is not actually vulnerable to any of those CVEs: https://github.com/tianon/gosu/blob/a1f38cab3a132e996dc4972605ec91e8650d4859/SECURITY.md
  2. No, it cannot be removed since it is used in the entrypoint to step down from root when running Redis
    https://github.com/docker-library/redis/blob/7487c7847c77730da6eea7cd5cfbd235eb2b6628/docker-entrypoint.sh#L11-L14

@jrwren
Copy link
Author

jrwren commented May 30, 2024

I realize it isn't a real vulnerability, but it shows as a HIGH score CVE in scan tools. Millions of man hours at workplaces all around the world have been wasted at trying to document around these false positive vulnerability scans. The gosu author refuses to make a release. An alternative is to remove gosu. Is there a reason su from util-linux or busybox can't be used instead?

@anonyknight
Copy link

Can we use su-exec to achieve the similar result?

https://gist.github.com/StevenACoffman/41fee08e8782b411a4a26b9700ad7af5

@tianon
Copy link
Contributor

tianon commented Jun 3, 2024

There's an outstanding parser bug in su-exec that means it falls back to silently running as root if you typo the username that's been fixed for five years but there hasn't been a new release in all that time. I sure wouldn't recommend it (and certainly wouldn't approve any new PRs adding it).

@jrwren
Copy link
Author

jrwren commented Jun 3, 2024

Can runuser (as suggested in the su man page) work?

Aren't these equivalent?

exec gosu redis "$0" "$@" 

and

exec runuser  -u redis -- "$0" "$@"

edit: ugh, never mind. Now I see runuser is from util-linux, but alpine/busybox do not have an equivalent.

edit2: maybe apk add runuser?

even with all of the deps it is still smaller (1416kb) than gosu (2250kb)

update: never mind. The semantics of runuser are not the same as gosu and rather than exec it does fork and exec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants