Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable wait for debugger in release builds #21

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

dviererbe
Copy link
Contributor

Rationale:

This may be used by an attacker to elevate privileges. The install and remove commands are executed with effective superuser privileges. If an attacker is able to attach a debugger they could execute arbitrary code with superuser privileges.

note: I tried to create a proof of concept for this attack, but failed with my naive attempts. It seems that the .NET debugger does not attach, because our release builds are compiled with -p:DebugType=none.
Trying to attach the LLDB debugger also did not work because of Yama protections. Read more about it here:
https://www.kernel.org/doc/Documentation/security/Yama.txt

I am not sure if the above-mentioned protections are sufficient or if it is just a skill issue on my side to exploit this feature. I am not aware that we use the debugger wait feature in release builds and therefore can simply remove it to not risk having a potential vulnerability.

This may be used by an attacker to elevate privileges.
The `install` and `remove` commands are executed with
effective superuser privileges. If an attacker is able
to attach a debugger they could execute arbitrary code
with superuser privileges.

note: I tried to create a proof of concept for this attack,
but failed with my naive attempts. It seems that the .NET
debugger does not attach, because our release builds are
compiled with `-p:DebugType=none`.
Trying to attach the LLDB debugger also did not work because
of Yama protections. Read more about it here:
https://www.kernel.org/doc/Documentation/security/Yama.txt

I am not sure if the above-mentioned protections are sufficient
or if it is just a skill issue on my side to exploit this feature.
I am not aware that we use the debugger wait feature in release
builds and therefore simply remove it to not risk having a
potential vulnerability.
@dviererbe dviererbe requested a review from a team as a code owner November 28, 2024 10:31
Copy link
Contributor

Test Results (arm64)

73 tests  ±0   73 ✅ ±0   0s ⏱️ ±0s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit b95ca06. ± Comparison against base commit 378a94d.

Copy link
Contributor

Test Results (amd64)

73 tests  ±0   73 ✅ ±0   0s ⏱️ ±0s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit b95ca06. ± Comparison against base commit 378a94d.

Copy link
Member

@mateusrodrigues mateusrodrigues left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dviererbe dviererbe merged commit 350512b into main Nov 28, 2024
7 checks passed
@dviererbe dviererbe deleted the feat/disable-debugger-wait-in-release-builds branch November 28, 2024 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants