All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, jrnieder@gmail.com
Subject: Re: [PATCH 0/4] credential: documentation updates for maint
Date: Thu, 7 May 2020 16:35:46 -0700	[thread overview]
Message-ID: <20200507233546.GB19917@Carlos-MBP> (raw)
In-Reply-To: <20200507221748.GA41996@coredump.intra.peff.net>

On Thu, May 07, 2020 at 06:17:48PM -0400, Jeff King wrote:
> On Thu, May 07, 2020 at 02:23:48PM -0700, Carlo Marcelo Arenas Belón wrote:
> > On Thu, May 07, 2020 at 04:59:09PM -0400, Jeff King wrote:
> > > On Wed, May 06, 2020 at 04:28:48PM -0700, Carlo Marcelo Arenas Belón wrote:
> > > 
> > > > Subject: [RFC PATCH 5/4] credential: document encoding assumptions for values
> > > > 
> > > > Because of the similarity on the names of the keys with what is defined
> > > > in RFC3986 is easy to assume the same rules would apply here.
> > > > 
> > > > Make sure that the format and encoding is well defined to avoid helper
> > > > developers assuming incorrectly.
> > > 
> > > I'm not sure this really clarifies anything, because it just says "no
> > > assumptions can be made". Which I guess is a statement, but I'm not sure
> > > what I'd do with it as a helper developer.
> > 
> > not sure what part of the added lines you are referring to but I am happy
> > to provide some examples of what I would expect to clarify below from
> > what I'd seen from some helpers that I'd read the code from recently.
> > 
> > as an example, I would expect the helper developer to start checking for
> > the locale and calling iconv in cases where it is not using utf-8, before
> > sending it to a storage that requires that (ex: osxkeychain), or utf-16
> > (maybe in windows).
> > 
> > osxkeychain will probably also check for protocol in a case insensitive
> > way to make sure it is not ignoring credentials that are not all lowercase
> > as it does now.
> 
> Those things all seem reasonable. I just meant that reading:
> 
>   No assumptions of case insensitivity can be made on their contents and
>   if a specific encoding is required (e.g. "UTF-8") then the byte
>   contents should be re-encoded before use.
> 
> didn't point me in a useful direction there. Reading it again, I'm still
> not sure if you're trying to say that helpers should match protocols
> case-insensitively or not.

What I am trying to clarify is that the URL or parameters they were passed
were not normalized (as it is usually expected for internal use as per
RFC3986), and therefore they can't just do a lowercase check for protocol
hoping it will match regardless of what was input by the user.

they could decide after that to treat credentials for HTTP differently
than the ones for http (like store does) or not, but at least now they
know what to expect.

then again, writing specs is not my forte, so if there is a better way to
express that I am happy to see an alternative.

> And TBH, I don't think it matters that much.
> It's a quality-of-implementation issue for helpers, and if nobody is
> complaining about their behavior, does it really matter?

it matters in principle; deep down any inconsistencies on behaviour
would eventually lead to bugs, and some of them (like the ones that
were raised recently) could have security implications.

one way we could help avoid inconsistent behaviour is by having a spec
that while allowing for a flexible implementation makes sure there is
no ambiguity that could result in mismatching interpretations.

> I'd be more
> concerned if doing the wrong thing involved a security vulnerability,
> but the worst case with case-insensitivity is probably that they _fail_
> to match a credential when they should.

I don't think any of these suggestions is directly related to a security
risk, eventhough as explained earlier has the longterm effect to reduce
the risk of one.

it is also not a final word, as usually having these controls implemented
multiple times is also a risk, and will be better IMHO longterm to do
the normalization once and get rid of them, but leaving them undefined
is IMHO a lost opportunity until then.

Carlo

  reply	other threads:[~2020-05-07 23:35 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-03  6:34 [RFC PATCH] credential: minor documentation fixes Carlo Marcelo Arenas Belón
2020-05-03  6:58 ` Jeff King
2020-05-04  7:45   ` Carlo Marcelo Arenas Belón
2020-05-04 14:44     ` Jeff King
2020-05-04 15:39       ` Carlo Marcelo Arenas Belón
2020-05-04 16:10         ` Jeff King
2020-05-04 15:58       ` Carlo Marcelo Arenas Belón
2020-05-04 16:13         ` Jeff King
2020-05-05  1:39 ` [PATCH 0/4] credential: documentation updates for maint Carlo Marcelo Arenas Belón
2020-05-05  1:39   ` [PATCH 1/4] credential: update description for credential_from_url_gently Carlo Marcelo Arenas Belón
2020-05-05  1:39   ` [PATCH 2/4] credential: correct order of parameters for credential_match Carlo Marcelo Arenas Belón
2020-05-05  1:39   ` [PATCH 3/4] credential: update gitcredentials documentation Carlo Marcelo Arenas Belón
2020-05-06 16:21     ` Jeff King
2020-05-05  1:39   ` [PATCH 4/4] credential: document protocol updates Carlo Marcelo Arenas Belón
2020-05-06 16:26     ` Jeff King
2020-05-06 16:27   ` [PATCH 0/4] credential: documentation updates for maint Jeff King
2020-05-06 23:28     ` Carlo Marcelo Arenas Belón
2020-05-07 20:59       ` Jeff King
2020-05-07 21:23         ` Carlo Marcelo Arenas Belón
2020-05-07 22:17           ` Jeff King
2020-05-07 23:35             ` Carlo Marcelo Arenas Belón [this message]
2020-05-06 21:47   ` [PATCH v2 " Carlo Marcelo Arenas Belón
2020-05-06 21:47     ` [PATCH v2 1/4] credential: update description for credential_from_url_gently Carlo Marcelo Arenas Belón
2020-05-06 21:47     ` [PATCH v2 2/4] credential: correct order of parameters for credential_match Carlo Marcelo Arenas Belón
2020-05-06 21:47     ` [PATCH v2 3/4] credential: update gitcredentials documentation Carlo Marcelo Arenas Belón
2020-05-07 20:54       ` Jeff King
2020-05-07 21:02         ` Junio C Hamano
2020-05-06 21:47     ` [PATCH v2 4/4] credential: document protocol updates Carlo Marcelo Arenas Belón
2020-05-07 20:57       ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200507233546.GB19917@Carlos-MBP \
    --to=carenas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.