mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #6792] potential double-free in procevent_monitor (SAST Warning) #3373
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#3373
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 @grey3228 on GitHub (Jun 26, 2025).
Original GitHub issue: https://github.com/netblue30/firejail/issues/6792
Hello!
I used the SAST tool Svace to analyze Firejail (v0.9.72) and encountered a warning about a potential double-free in
src/firemon/procevent.c. I'd like to verify whether this is a false positive or a legitimate issue.Warning Details
In
procevent_monitor, the tool flags a scenario wherecmdmight be freed twice:Concern
The double-free could occur if:
Proposed Fix
To prevent this, we could add a check before freeing cmd:
Questions
Thank you for your time and expertise!
@kmk3 commented on GitHub (Jul 1, 2025):
Thanks for reporting this.
This is a preliminary response as I haven't finished looking into this, but
after a brief look at the current code, your analysis of the problem seems to
be correct.
Note that we do not maintain that version of firejail:
Versions other than the latest usually have outdated profiles and may contain
bugs and security vulnerabilities that were fixed in later versions.
See also:
Is there a specific reason that you're using 0.9.72?
@grey3228 commented on GitHub (Jul 2, 2025):
@kmk3 , thank you for your response!
I worked on a system with installed firejail package of version v0.9.72, so I tried to analyze this particular version. As I see, same potential issue exists in newer version. If this issue will be confirmed, it would be great to get fix in newer supported versions anyway.
@grey3228 commented on GitHub (Jul 31, 2025):
@kmk3 hello! Sorry for disturbing. If this is a bug, do you mind if I create PR with proposed fix or you prefer to fix it by yourself?
@kmk3 commented on GitHub (Jul 31, 2025):
All good, I was planning on following up on this soon.
Last time I looked at this, it seemed to be a real bug.
IIRC I had tried to come up with something slightly different but after working
on the code for a while your proposed fix still seemed better in the end, so
please open a PR.
@grey3228 commented on GitHub (Jul 31, 2025):
Ok, thanks, I'll open PR soon then!