microsoft / microsoft/SysinternalsEBPF
Check installer permissions using geteuid
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 288
- Forks
- 38
- Avg merge
- 21d 13h
- Merged PRs (30d)
- 1
Description
Hi!
I noticed EBPF doesn't correctly check the permission whether the user has root privilege or not. Instead, it relies on other functions' errors. (E.g. In libsysinternalsEBPFinstaller.c at line 279, it relies on mkdir(...) and stat(...) functions' success/errors). It would be better to just check the permission through geteuid(...) instead.
if (geteuid() != (uid_t)0) {
// Error message
}
Something like this also fixes an issue where with the -u flag (uninstall), the installer (libsysinternalsEBPFinstaller.c) doesn't check the permission at all.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in libsysinternalsEBPFinstaller.c around line 279 and trace both the normal installation path and the -u uninstall path. Check how the current mkdir/stat errors are used for permission handling, then verify that both paths reject users whose geteuid is not zero with an appropriate error message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- cli, security
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100