microsoft / microsoft/SysinternalsEBPF

Check installer permissions using geteuid

Open
#43 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.