Accept OAuth2 POST form credentials on registry /v2/token #180
Reference in New Issue
Block a user
Delete Branch "benvin/registry-token-oauth-post"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Registry write gating broke buildkit pushes: containerd's resolver fetches tokens with an OAuth2 POST form (credential in the body, not an Authorization header), so
/v2/tokenissued the anonymous token and uploads 401'd withinvalid token.passwordorrefresh_tokenfield of a urlencodedPOST /v2/tokenbody, capped at 16 KiB; multipart is never parsedr.PostFormValuecallsParseMultipartForm, so an unauthenticatedmultipart/form-dataPOST to/v2/tokenis parsed with no body cap: files over 32MB spill to temp files on disk, and nothing upstream setsMaxBytesReader. Verified with a 60MB multipart body (temp file written). → wrapr.Bodyinhttp.MaxBytesReader(a few KB) and user.ParseForm()+r.PostForm.Get(...), so multipart is never parsed.No findings.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.