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

Re: Proposal for missing blob support in Git repos

From
JTJonathan Tan <jonathantanmy@google.com>
Date
May 2, 2017, 00:33 UTC
Message-ID
<c0c8a0c3-582c-cf3b-3833-c918a0630f9f@google.com>
In-Reply-To
<xmqq1ss8gnqn.fsf@gitster.mtv.corp.google.com>
On 05/01/2017 04:29 PM, Junio C Hamano wrote:
Show 14 quoted lines
> Jonathan Tan <jonathantanmy@google.com> writes:
>
>> Thanks for your comments. If you're referring to the codepath
>> involving write_sha1_file() (for example, builtin/hash-object ->
>> index_fd or builtin/unpack-objects), that is fine because
>> write_sha1_file() invokes freshen_packed_object() and
>> freshen_loose_object() directly to check if the object already exists
>> (and thus does not invoke the new mechanism in this patch).
>
> Is that a good thing, though?  It means that you an attacker can
> feed one version to the remote object store your "grab blob" hook
> gets the blobs from, and have you add a colliding object locally,
> and the usual "are we recording the same object as existing one?"
> check is bypassed.

If I understand this correctly, what you mean is the situation where the hook adds an object to the local repo, overriding another object of the same name? If yes, I think that is the nature of executing an arbitrary command. If we really want to avoid that, we could drop the hook functionality (and instead, for example, provide the URL of a Git repo instead from which we can communicate using a new fetch-blob protocol), although that would reduce the usefulness of this, especially during the transition period in which we don't have any sort of batching of requests.

Previous: Junio C HamanoNext: Brandon Williams
Message 5 of 12 in “Proposal for missing blob support in Git repos”
  1. Jonathan TanApr 26, 2017
  2. Junio C HamanoMay 1, 2017
  3. Jonathan TanMay 1, 2017
  4. Junio C HamanoMay 1, 2017
  5. Jonathan TanMay 2, 2017
  6. Brandon WilliamsMay 2, 2017
  7. Junio C HamanoMay 2, 2017
  8. Jonathan TanMay 2, 2017
  9. Ævar Arnfjörð BjarmasonMay 2, 2017
  10. Jonathan TanMay 2, 2017
  11. Junio C HamanoMay 4, 2017
  12. Jonathan TanMay 4, 2017

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.