Skip to content
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

🚑️ OIDC: use Azure-AD unique identifier #2510

Merged
merged 1 commit into from
Aug 14, 2023

Conversation

universam1
Copy link
Contributor

We are facing a security vulnerability by the use of DisplayName as the unique identifier in Azure-AD.

Since this field can be duplicated it can be exploited to gain privileges.

https://morgansimonsen.com/2016/06/28/azure-ad-allows-duplicate-group-names/

Switching to the guaranteed unique identifier onPremisesSamAccountName available in the Microsoft Graph API

@universam1
Copy link
Contributor Author

@szuecs Do you see a chance this to be merged soon?

We are facing a security vulnerability by the use of `DisplayName` as the unique identifier in Azure-AD.

Since this field can be duplicated it can be exploited to gain privileges.

https://morgansimonsen.com/2016/06/28/azure-ad-allows-duplicate-group-names/

Switching to the guaranteed unique identifier `onPremisesSamAccountName` available in the Microsoft Graph API

Signed-off-by: Samuel Lang <[email protected]>
@szuecs
Copy link
Member

szuecs commented Aug 11, 2023

👍

1 similar comment
@MustafaSaber
Copy link
Member

👍

@@ -1075,7 +1075,9 @@ func (f *tokenOidcFilter) resolveDistributedClaimAzure(url *url.URL, oauth2Token
return nil, fmt.Errorf("unabled to decode response: %w", err)
}
for _, v := range target.Value {
values = append(values, v.DisplayName)
if v.OnPremisesSamAccountName != "" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching to the guaranteed unique identifier onPremisesSamAccountName available in the Microsoft Graph API

Could it be empty?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And should we have a test to ensure behaviour when it is empty?

Copy link
Contributor Author

@universam1 universam1 Aug 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it can be empty and I have extended a test to reflect it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onPremisesSamAccountName does not look like a standard attribute so we have to rely on you testing that this works correctly.

I guess id is also not stable/reliable to use for the purpose, is it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The onPremisesSamAccountName is the equivalent of the samAccountName issued with the standard group claim.

But it might be that someone rather would like the GUID / ID to be issued, it is configurable in Azure app registration.

If you want @AlexanderYastrebov the field selector could be extended to be configurable. If so, which way, using a flag or another filter parameter?

Copy link
Member

@AlexanderYastrebov AlexanderYastrebov Aug 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not use azure-based auth and have no experience with it. Lets have it like you proposed and see if we get any feedback on the change from other users.

@AlexanderYastrebov AlexanderYastrebov merged commit 0ee30aa into zalando:master Aug 14, 2023
6 checks passed
@universam1 universam1 deleted the uniqueID branch August 14, 2023 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants