Disable wait for debugger in release builds #21
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rationale:
This may be used by an attacker to elevate privileges. The
install
andremove
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.