git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] http: prevent redirect from dropping credentials during reauth

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Feb 4, 2024, 22:36 UTC
Message-ID
<ZcARb4YNCD4NLJku@tapette.crustytoothpaste.net>
In-Reply-To
<20240204185427.39664-3-ypsah@devyard.org>
On 2024-02-04 at 18:54:27, Quentin Bouget wrote:
Show 8 quoted lines
> During a re-authentication (second attempt at authenticating with a
> remote, e.g. after a failed GSSAPI attempt), git allows the remote to
> provide credential overrides in the redirect URL and unconditionnaly
> drops the current HTTP credentials in favors of those, even when there
> aren't any.
> 
> This commit makes it so HTTP credentials are only overridden when the
> redirect URL actually contains credentials itself.

I don't think your proposed change is safe. Credentials are supposed to be tied to a certain site and may even be tied to a specific repository, and if there's a redirect, then we need to re-fetch credentials or we could leak credentials to the wrong site by reusing them. Your change would therefore introduce a security vulnerability.

I should also point out that in general we are trying to make it less easy and less convenient for people to use credentials in the URL because that always necessitates insecure storage. There have in fact been proposals to remove that functionality entirely.

-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA
Previous: Quentin BougetNext: Quentin Bouget
Message 7 of 15 in “Fix gitlab's token-based authentication w/ kerberos”
  1. 0/2 Fix gitlab's token-based authentication w/ kerberosQuentin Bouget, Feb 4, 2024
  2. 1/2 http: only reject basic auth credentials once they have been triedQuentin Bouget, Feb 4, 2024
  3. Junio C HamanoFeb 4, 2024
  4. Quentin BougetFeb 5, 2024
  5. Patrick SteinhardtFeb 5, 2024
  6. 2/2 http: prevent redirect from dropping credentials during reauthQuentin Bouget, Feb 4, 2024
  7. brian m. carlsonFeb 4, 2024
  8. Quentin BougetFeb 5, 2024
  9. brian m. carlsonFeb 5, 2024
  10. rsbecker@nexbridge.comFeb 5, 2024
  11. Junio C HamanoFeb 4, 2024
  12. Quentin BougetFeb 5, 2024
  13. rsbecker@nexbridge.comFeb 4, 2024
  14. Quentin BougetFeb 5, 2024
  15. Robert CoupFeb 5, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.