mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #6399] --private allows writing to the real ~/.bashrc (shell redirect) #3264
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#3264
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 @ghost on GitHub (Jul 6, 2024).
Original GitHub issue: https://github.com/netblue30/firejail/issues/6399
Yesterday on IRC something odd came up regarding the
privateoption. Expecting this option to create a sandbox in which all modifications getdiscardedat shutdown, it turns out this isn't respected.The following command variations all allow editing ${HOME}/.bashrc:
So, to summarize:
read-onlyviadisable-common.inc(included fromdefault.profile) is not being enforced;privateshouldn't allow this;blacklisting${HOME}/.bashrc is not preventing this from happening.This easy and unexpected circumvention of the above restrictions make me wonder what is actually causing this (besides apparent shell redirection). I could use a sanity check here :)
Note: I'm seeing this on my
firejail-git, but a user confirmed this also happens on0.9.72.@rusty-snake commented on GitHub (Jul 6, 2024):
Shell redirection is a feature of your shell. i.e. the process that writes to
~/.bashrcin the following process tree is the bash process that wraps/starts firejail.@kmk3 commented on GitHub (Jul 6, 2024):
@rusty-snake on Jul 6:
The shell indeed opens the file and sets up the redirection before firejail
starts, though I think that technically the child process is still the one that
writes to the stream.
@glitsj16
Can you reproduce this without shell redirects?
@rusty-snake commented on GitHub (Jul 6, 2024):
Well, technically your right. Though it only helps if you understand the difference between open and read/write.
@ghost commented on GitHub (Jul 7, 2024):
All good without shell redirection:
Sorry for the noise.