The vulnerability lies in Fleet's Windows MDM enrollment flow, which allowed authentication tokens from any Azure AD tenant to be accepted. This was because Fleet did not enforce the aud (audience) or iss (issuer) claims in the JWT. An attacker could obtain a valid Microsoft-signed token from any Azure AD tenant and use it to enroll unauthorized devices and access Fleet's MDM management APIs.
The analysis of the patch reveals that the fix was implemented in two key functions:
-
server/service/microsoft_mdm.go:(*Service).authBinarySecurityToken: This function handles the authentication of the binary security token. The patch introduces validation for the aud (audience) claim, ensuring it matches the Fleet server's URL, and the tid (tenant ID) claim, ensuring it belongs to the list of configured Entra Tenant IDs. The vulnerable version of the code was missing these critical checks.
-
server/mdm/microsoft/wstep.go:GetAzureAuthTokenClaims: This function extracts claims from the Azure JWT. The patch adds logic to validate that the iss (issuer) claim matches the tid (tenant ID) claim. This prevents the use of tokens issued by a different, unauthorized tenant.
By adding these validation steps, the patch ensures that only tokens from the configured Azure AD tenant and intended for the specific Fleet instance can be used for MDM enrollment, effectively mitigating the authentication bypass vulnerability.