mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[PR #3241] [MERGED] Harden sbox_run by using fexecve instead of execvp #4694
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#4694
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?
📋 Pull Request Information
Original PR: https://github.com/netblue30/firejail/pull/3241
Author: @kris7t
Created: 2/23/2020
Status: ✅ Merged
Merged: 2/23/2020
Merged by: @kris7t
Base:
master← Head:sbox-harden-exec📝 Commits (2)
ead0c01Harden sbox_run by using fexecve instead of execvpb7f2906Remove redundant permission check from dhcp_start📊 Changes
2 files changed (+38 additions, -27 deletions)
View changed files
📝
src/firejail/dhcp.c(+2 -12)📝
src/firejail/sbox.c(+36 -15)📄 Description
Based on the discussion in #3239, this patch aims to make
sbox_runless likely to execute malicious binaries as root.execvpcall is replaces withfexecve, which does not perform PATH resolution. Because the environment was already cleared, this already wasn't a serious problem. But now, by passing absolute paths only to sbox_run, we get a bit more control.openwithO_PATHandfexecveprevents TOCTOU errors with the permission check. This prevents a situation when the containing folder is somehow owned by a normal user (maybe by abusing some other setuid functionality to mount a tmpfs over it), and the binary we wish to run is replaced by a malicious one after we check its permissions.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.