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

Re: [RFC PATCH] list-objects-filter: disable 'sparse:path' filters

From
Christian Couder <christian.couder@gmail.com>
Date
May 24, 2019, 12:39 UTC
Message-ID
<CAP8UFD2HJ2D9Sndud5Wu7Vyz9Jj-mVkpE4oowd3VaXoV3nugcw@mail.gmail.com>
In-Reply-To
<87ef4of3g6.fsf@evledraar.gmail.com>

On Fri, May 24, 2019 at 2:21 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:

Show 20 quoted lines
>
>
> On Fri, May 24 2019, Christian Couder wrote:
>
> > If someone wants to use as a filter a sparse file that is in the
> > repository, something like "--filter=sparse:oid=<ref>:<path>"
> > already works.
> >
> > So 'sparse:path' is only interesting if the sparse file is not in
> > the repository. In this case though the current implementation has
> > a big security issue, as it makes it possible to ask the server to
> > read any file, like for example /etc/password, and to explore the
> > filesystem, as well as individual lines of files.
>
> Removing this is a good idea.
>
> Just to clarify, what was the attack surface in practice? We pass this
> to add_excludes_from_file_to_list(), are there cases where it'll spew
> out parse errors/warnings that allow you to extract content from such a
> file?
Peff provided an example script in:
https://public-inbox.org/git/20181108050755.GA32158@sigill.intra.peff.net/
Show 9 quoted lines
> Or does it amount to a DoS vector by pointing to some huge (binary?)
> file on-disk, or a security issue where you could via the error or
> timings discover whether the file exists or not, something else?
>
> I wonder if server operators need to be paranoid about the DoS from the
> issue with <oid>:<path> noted int/perf/p0100-globbing.sh which this is
> presumably vulnerable to, i.e. someone with repository write access
> uploading pathological patterns. That might be particularly annoying for
> e.g. GitHub where the fork network's object storage is shared.

In general servers should limit the git processes they launch, but yeah it might be interesting to look at that too.

Previous: Ævar Arnfjörð BjarmasonNext: Jeff Hostetler
Message 3 of 9 in “list-objects-filter: disable 'sparse:path' filters”
  1. list-objects-filter: disable 'sparse:path' filtersChristian Couder, May 24, 2019
  2. Ævar Arnfjörð BjarmasonMay 24, 2019
  3. Christian CouderMay 24, 2019
  4. Jeff HostetlerMay 24, 2019
  5. Jeff KingMay 28, 2019
  6. Jeff HostetlerMay 28, 2019
  7. Matthew DeVoreMay 24, 2019
  8. Christian CouderMay 24, 2019
  9. Jeff HostetlerMay 24, 2019

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.