-
Notifications
You must be signed in to change notification settings - Fork 4k
Fix for Server Challenge Token Security Incident #28177
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
base: main
Are you sure you want to change the base?
Conversation
Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses CVE-2025-47158 by strengthening how the server challenge token’s secret file path is parsed and validated.
- Renamed and clarified the header variable and improved its parsing
- Centralized path normalization and validation in a new
IsSecretFilePathValid
helper - Updated error handling to use a consistent error resource
Comments suppressed due to low confidence (3)
src/StorageSync/StorageSync/Interop/ManagedIdentity/ServerManagedIdentityUtils.cs:275
- [nitpick] The variable name
wwwHeader
is ambiguous. Consider renaming it to something more descriptive likeauthenticateHeaderValue
orchallengeHeaderValue
to improve readability.
var wwwHeader = authenticateHeaderValues.FirstOrDefault();
src/StorageSync/StorageSync/Interop/ManagedIdentity/ServerManagedIdentityUtils.cs:344
- The new
IsSecretFilePathValid
method contains critical security logic but lacks dedicated unit tests. Please add tests covering valid paths, invalid paths, edge cases, and path traversal attempts.
private static bool IsSecretFilePathValid(string secretFilePath)
src/StorageSync/StorageSync/Interop/ManagedIdentity/ServerManagedIdentityUtils.cs:296
- [nitpick] Reusing the same error message for both a missing secret file and an invalid path may be confusing. Consider using distinct error codes or messages to differentiate missing file vs invalid path scenarios.
StorageSyncResources.AgentMI_InvalidSecretFileError,
src/StorageSync/StorageSync/Interop/ManagedIdentity/ServerManagedIdentityUtils.cs
Outdated
Show resolved
Hide resolved
src/StorageSync/StorageSync/Interop/ManagedIdentity/ServerManagedIdentityUtils.cs
Outdated
Show resolved
Hide resolved
/azp run azure-powershell - security-tools |
Azure Pipelines successfully started running 1 pipeline(s). |
Please provide the test result before and after this change. Thanks! |
Co-authored-by: Copilot <[email protected]>
Description
This change makes a fix for CVE-2025-47158
Incident 31000000381506 : [MSRC] [98867] - ElevationOfPrivilege - Local Privilege Escalation that results in Arbitrary File Read in Azure File Sync Agent on Arc enabled Windows server
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.md
and reviewed the following information:ChangeLog.md
file(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
.## Upcoming Release
header in the past tense.ChangeLog.md
if no new release is required, such as fixing test case only.