fix(agent): compare broker client executables by file identity - #1869
Conversation
Replaces the lossy, case-insensitive path string comparison used to authenticate package broker pipe clients with a direct file identity check based on GetFileInformationByHandleEx (FILE_ID_INFO), which is immune to Unicode casing and invalid UTF-8 edge cases. Also removes the redundant canonicalize helper. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Let maintainers know that an action is required on their side
|
|
Implementation notes:
|
There was a problem hiding this comment.
Pull request overview
Replaces fragile executable path-string comparison with Windows file identity checks for broker client authentication.
Changes:
- Compares volume serial numbers and 128-bit file IDs.
- Adds tests for equivalent paths and distinct files.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The package broker authenticated pipe clients by comparing executable path strings using a lossy, ASCII-case-insensitive comparison. This was fragile for a security-relevant identity check, as it could be tripped up by Unicode casing rules, invalid UTF-8, and other path representation edge cases.
The broker now opens both executables and compares their file identity directly (volume serial number + 128-bit file ID via
GetFileInformationByHandleEx/FILE_ID_INFO), which is immune to these edge cases.Issue: DGW-419