git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Aaron Pelly <aaron@pelly.co>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: Expanding Includes in .gitignore
Date: Fri, 28 Oct 2016 10:55:40 +1300	[thread overview]
Message-ID: <60a652f6-864e-bbda-7394-4751c92866b7@pelly.co> (raw)
In-Reply-To: <20161027205508.vqw44zlbnqpj2cvd@sigill.intra.peff.net>

On 28/10/16 09:55, Jeff King wrote:
> On Fri, Oct 28, 2016 at 09:28:23AM +1300, Aaron Pelly wrote:
> 
>>>   - we parse possibly-hostile .gitignore files from cloned repositories.
>>>     What happens when I include ask to include /etc/passwd? Probably
>>>     nothing, but there are setups where it might matter (e.g., something
>>>     like Travis that auto-builds untrusted repositories, and you could
>>>     potentially leak the contents of files via error messages). It's
>>>     nice to avoid the issue entirely.
>>
>> I understand the issue.
>>
>> It's not obvious to me how using a .d solves this problem though.
> 
> It doesn't by itself. But we are worried only about tracked .gitignore
> files (recall that even repo-level files in $GIT_DIR/info are generated
> fresh by the clone process, and don't come from the remote). If we apply
> the feature only to core.excludeFile and $GIT_DIR/info/exclude, those
> are already under the user's control.

The things you say make sense from this perspective.

I was hoping to employ this mechanism throughout the git ecosystem.

Thinking out loud for a minute:

1) I clone a repo with a hostile ignore file. It includes files from
/etc/ssl/private or some such. Change. Don't pay attention. Commit.
Push. Problems.

What is the use case for reaching out of the repo in the first place?

2) I fetch a repo with a hostile ignore file. It includes files from
$GIT_DIR/test-data/ssl/private or some such. Change. Don't pay
attention. Commit. Push. Problems if my test data comes from production.

Is this mitigated currently?

Not that git should be an enabler, but surely it falls on the user of
untrusted software to ensure their own security?

> It's true that we could make a similar exception for an "include"
> feature, and respect include directives only in those "safe" files.
> Somehow that seems more confusing to me, though, than doing adding the
> feature at the file level, as it introduces slightly varying syntax
> between the locations.

I'm quickly getting over the include file idea. But yes, that would be
non obvious.

>>> Whereas letting any of the user- or repo-level exclude files be a
>>> directory, and simply reading all of the files inside, seems simple and
>>> obvious.
>>
>> Apart from backwards compatibility, unless there's something I'm missing.
> 
> I'm not sure what you mean. If we make:
> 
>   mkdir .git/info/exclude
>   echo whatever >.git/info/exclude/local
> 
> work, I don't think we have to care about backwards compatibility. That
> was nonsensical before, and never did anything useful (so somebody might
> have done it, but we can assume anybody relying on it not to read the
> contents is crazy).

Seeing your perspective, now, I can see why you didn't understand me. In
your context this makes perfect sense.


  parent reply	other threads:[~2016-10-27 21:55 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-27  0:22 Expanding Includes in .gitignore Aaron Pelly
2016-10-27  2:22 ` Stefan Beller
2016-10-27  9:51   ` Aaron Pelly
2016-10-27  8:19 ` Alexei Lozovsky
2016-10-27 10:33   ` Aaron Pelly
2016-10-27 10:50 ` Jeff King
2016-10-27 19:48   ` Jacob Keller
2016-10-27 20:59     ` Aaron Pelly
2016-10-27 21:04     ` Jeff King
2016-10-27 21:26       ` Aaron Pelly
2016-10-27 21:39       ` Jacob Keller
2016-10-30  3:09       ` Duy Nguyen
2016-10-27 20:28   ` Aaron Pelly
2016-10-27 20:55     ` Jeff King
2016-10-27 21:07       ` Jeff King
2016-10-27 22:30         ` Aaron Pelly
2016-10-27 23:07         ` Aaron Pelly
2016-10-28  2:54         ` Junio C Hamano
2016-10-28  9:32           ` Aaron Pelly
2016-10-30  3:16             ` Duy Nguyen
2016-10-30 12:54             ` Jeff King
2016-10-27 21:55       ` Aaron Pelly [this message]
2016-10-27 22:17         ` Aaron Pelly
2016-10-28  8:10           ` 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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=60a652f6-864e-bbda-7394-4751c92866b7@pelly.co \
    --to=aaron@pelly.co \
    --cc=git@vger.kernel.org \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).