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

docker login failed with "HTTP 400 Bad Request - Request Header Or Cookie Too Large " error when using VM managed identity authentication #797

Open
boliu83 opened this issue Dec 4, 2024 · 0 comments
Labels

Comments

@boliu83
Copy link

boliu83 commented Dec 4, 2024

Describe the bug
Docker CLI login using Azure VM managed identity failed with HTTP 400 Bad Request - Request Header Or Cookie Too Large error when the AAD access token exceeds certain size (6089 characters in my test).

AAD access token obtained from IMDS auth endpoint normally is much smaller than 6089 characters, however in some cases e.g. identity is member of large number of security groups, then token size can grow beyond 6089 charaters due to the list of groups membership is also included in the access token.

This issue has already been reported to ACR PG. Creating issue here as requested by the end customer so he can track the status of the fix.

To Reproduce
Steps to reproduce the behavior:

  1. Generate token/password with 6090 characters or more. for testing purpose this does not have to be an actual AAD access token.
    TOKEN=strings /dev/urandom | tr -dc A-Za-z0-9 | head -c6090

  2. Run docker login using the token
    docker -D login -u 00000000-0000-0000-0000-000000000000 -p $TOKEN fqdn.azurecr.io

  3. Expect the login to fail due to 400 Request Header Or Cookie Too Large error

Expected behavior
Docker login should succeed when using AAD token regardless of the size of group list in the token.

Screenshots
Image

Any relevant environment information

  • OS: [e.g. Ubuntu, Windows]
  • Azure CLI/PowerShell/SDK version
  • Docker version
  • Datetime (UTC) when the issue occurred
  • Registry and image names

Additional context
Add any other context about the problem here.

If any information is a concern to post here, you can create a support ticket or send an email to [email protected].

@boliu83 boliu83 added the bug label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant