mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #1964] UID_MIN evaluation at runtime #1319
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#1319
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @reinerh on GitHub (May 29, 2018).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1964
Currently UID_MIN is obtained at build time from /etc/login.defs.
This will break for users of binary distributions that don't compile software themselves, because they can't use firejail with users that have a lower UID.
A Debian user reported this problem, as his user has a UID of 256, while the default on the build servers is 1000 (which is not guaranteed; the build server could be configured to have a MIN_UID over 9000).
So instead of hardcoding this, I would suggest to obtain that limit at runtime.
(This might also be the reason in #1963.)
@mestia commented on GitHub (May 29, 2018):
What is rationale behind this check for UID_MIN?
Isn't it much better to allow only users defined in the database?
@netblue30 commented on GitHub (May 30, 2018):
Will do!
root user is allowed by default, all other system users (numbers below UID_MIN) run the program as is, without any jail.
@mestia commented on GitHub (May 30, 2018):
Got it now. Thank you for clarification.
@netblue30 commented on GitHub (Jun 4, 2018):
All set, commit:
ac92833652@reinerh commented on GitHub (Jun 30, 2018):
@netblue30 can this be closed, or is there a reason why you reopened it?
@nyarvin commented on GitHub (Jul 12, 2018):
While the comment in the code (and a comment above) says "all other system users ... run the code as is, without any jail", that's not the effect I see: instead they are blocked from running it, with an error message printed. Which to my mind is probably better than dropping the jail, anyway -- it's dangerous for protections to silently be dropped. So better to change the comment than the behavior. But also, as it stands, system users can't be allowed to run firejail even by adding their names to firejail.users. I'm interested in this because, for historical reasons, my user id lies in the range of "system users"; I could of course change this, but it's never caused problems before. In general, decreeing that no system user can ever use firejail seems rather odd; surely there's a good use or two out there, even if most system user sandboxing is better done via other means. So I recommend, in firejail_user.c, rearranging the code so as to move the check for system users inside the subsequent if statement, so that it only applies when there is no firejail_users file provided. That way if someone does explicitly allow a system user it will work, yet by default they'll still be blocked.
@Vincent43 commented on GitHub (Jul 13, 2018):
@netblue30 can you confirm above?
@JulienPalard commented on GitHub (Jul 16, 2018):
I can confirm, and I'm in the same position, I'm using firejail from a system user (ID 999), and even by adding it to the firejail.users it won't be allowed to use firejail, which if find sad.
@Vincent43 commented on GitHub (Jul 16, 2018):
@nyarvin @JulienPalard I assume you are running latest firejail compiled from github , right?
@nyarvin commented on GitHub (Jul 17, 2018):
My comments were based on the 0.9.54 release. But using the github browser to look at the current firejail_user_check() code in src/lib/firejail_user.c, I don't see any changes, at least not any that would modify my comments.
@Vincent43 commented on GitHub (Jul 17, 2018):
@nyarvin but the commit which is supposed to enable runtime checking is from June 4 while firejail 0.9.54 release is from May 16.
Please test latest git snapshot.
@nyarvin commented on GitHub (Jul 17, 2018):
Runtime checking isn't an issue for me; I was commenting on other aspects of this. (Which maybe should be moved to a separate issue; if so, apologies for putting them here.)
@Vincent43 commented on GitHub (Jul 17, 2018):
@nyarvin ok, please open new issue then.