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

Re: [PATCH] osxkeychain: restrict queries to requests with a valid host

From
Calvin Wan <calvinwan@google.com>
Date
Apr 22, 2024, 19:48 UTC
Message-ID
<20240422194824.340464-1-calvinwan@google.com>
In-Reply-To
<20200420224310.9989-1-carenas@gmail.com>
Carlo Marcelo Arenas Belón  <carenas@gmail.com> writes:
Show 28 quoted lines
> make sure that requests to this helper to get credentials return early if
> there is no host ord the host is empty.
> 
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> ---
>  contrib/credential/osxkeychain/git-credential-osxkeychain.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/contrib/credential/osxkeychain/git-credential-osxkeychain.c b/contrib/credential/osxkeychain/git-credential-osxkeychain.c
> index bcd3f575a3..2264a88c41 100644
> --- a/contrib/credential/osxkeychain/git-credential-osxkeychain.c
> +++ b/contrib/credential/osxkeychain/git-credential-osxkeychain.c
> @@ -69,6 +69,12 @@ static void find_internet_password(void)
>  	UInt32 len;
>  	SecKeychainItemRef item;
>  
> +	/*
> +	 * Require at valid host to fix CVE-2020-11008
> +	 */
> +	if (!host || !*host)
> +		return;
> +
>  	if (SecKeychainFindInternetPassword(KEYCHAIN_ARGS, &len, &buf, &item))
>  		return;
>  
> -- 
> 2.26.2.111.gbff22aa583
> 

We're currently using this patch downstream (removed the check for !*host after updates to this file), but I was wondering whether this change should also be in main. It seems like the discussion around this stalled and there was no definitive conclusion, but the change also at worst does nothing and could possibly be useful -- I see other functions where we're checking for the existence of "host". I wasn't around when all the changes around this CVE were happening so I'm not exactly sure how useful this patch this and whether we can get rid of it or not.

Previous: Jonathan NiederNext: Jeff King
Message 6 of 7 in “osxkeychain: restrict queries to requests with a valid host”
  1. osxkeychain: restrict queries to requests with a valid hostCarlo Marcelo Arenas Belón, Apr 20, 2020
  2. Junio C HamanoApr 20, 2020
  3. Carlo ArenasApr 20, 2020
  4. Junio C HamanoApr 21, 2020
  5. Jonathan NiederApr 21, 2020
  6. Calvin WanApr 22, 2024
  7. Jeff KingApr 23, 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.