Adds client uid validation to XPC server.#896
Merged
jglogan merged 5 commits intoapple:mainfrom Nov 19, 2025
Merged
Conversation
7 tasks
dkovba
reviewed
Nov 18, 2025
Contributor
dkovba
left a comment
There was a problem hiding this comment.
Should we add automated tests for the UID validation?
Contributor
Author
Thoughts on how we do that? Would these only run locally? How would we change id without running as root to set UID programmatically, require user interaction, or modify a sudoers file? |
c315372 to
f4d56ef
Compare
dkovba
reviewed
Nov 19, 2025
Contributor
dkovba
left a comment
There was a problem hiding this comment.
Agree that testing would be more complex than the code itself.
dkovba
approved these changes
Nov 19, 2025
saehejkang
pushed a commit
to saehejkang/container
that referenced
this pull request
Jan 27, 2026
- When a user performs an `su` the effective UID changes but the bootstrap mach port does not, so that if container is running as `alice` from a GUI login session, it's possible to `su bob` and continue running container. While this doesn't pose a significant security risk as it's necessary for Alice to know Bob's password and manually enter it with `su`, this change closes the loophole by validating that client UID from the caller's audit token matches that of the API server.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Type of Change
Motivation and Context
When a user performs an
suthe effective UID changes but the bootstrap mach port does not, so that if container is running asalicefrom a GUI login session, it's possible tosu boband continue running container. While this doesn't pose a significant security risk as it's necessary for Alice to know Bob's password and manually enter it withsu, this change closes the loophole by validating that client UID from the caller's audit token matches that of the API server.Testing