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

Re: [RFC PATCH 0/2] Allow adding .git files and directories

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Aug 22, 2020, 18:53 UTC
Message-ID
<20200822185307.GZ8085@camp.crustytoothpaste.net>
In-Reply-To
<20200822162152.2be1d024@luklap>
On 2020-08-22 at 14:21:52, Lukas Straub wrote:
Show 25 quoted lines
> On Fri, 21 Aug 2020 22:52:37 +0000
> "brian m. carlson" <sandals@crustytoothpaste.net> wrote:
> 
> > On 2020-08-21 at 12:39:41, Lukas Straub wrote:
> > > The downsides we discussed don't apply in this usecase. These are mostly
> > > personal files, so I wont upload them to any hosting site (not even private
> > > ones). There is no security impact as I only sync with trusted devices.  
> > 
> > I realize this works for you, but in general Git's security model does
> > not permit untrusted configuration files or hooks.  Configuration can
> > have numerous different commands that Git may execute and it is not, in
> > general, safe to share across users.  This is why Git does not provide a
> > way to sync whole repositories, only the objects within them.
> > 
> > Adding the ability to transport configuration through a repository is a
> > security problem because it allows an attacker to potentially execute
> > arbitrary code on the user's machine, and I can tell you that many, many
> > people do clone untrusted repositories.  Just because you are aware of
> > the risks, are comfortable with them, and are the only user in this
> > scenario does not mean that this feature is a prudent one to add to Git.
> > It violates our own security model, and as such, isn't a feature we're
> > going to want to add.
> 
> I don't understand. If the attacker gets the user to set git config options,
> then all hope is lost anyways, no?

When you can embed repositories in other repositories like you're proposing, those embedded repositories can have configuration files in them (e.g., .git/config), which leads to the security problem.

-- 
brian m. carlson: Houston, Texas, US
Previous: Lukas StraubNext: Lukas Straub
Message 19 of 27 in “Allow adding .git files and directories”
  1. 0/2 Allow adding .git files and directoriesLukas Straub, Aug 19, 2020
  2. 2/2 dir: Recurse into nested git repos if they aren't submodulesLukas Straub, Aug 19, 2020
  3. 1/2 dir/read-cache: Allow adding .git files and directoriesLukas Straub, Aug 19, 2020
  4. Junio C HamanoAug 19, 2020
  5. Randall S. BeckerAug 19, 2020
  6. Junio C HamanoAug 19, 2020
  7. Randall S. BeckerAug 19, 2020
  8. Jeff KingAug 19, 2020
  9. Junio C HamanoAug 19, 2020
  10. Jeff KingAug 19, 2020
  11. Randall S. BeckerAug 19, 2020
  12. Johannes SchindelinAug 20, 2020
  13. Lukas StraubAug 20, 2020
  14. Jeff KingAug 20, 2020
  15. Lukas StraubAug 21, 2020
  16. Randall S. BeckerAug 21, 2020
  17. brian m. carlsonAug 21, 2020
  18. Lukas StraubAug 22, 2020
  19. brian m. carlsonAug 22, 2020
  20. Lukas StraubAug 22, 2020
  21. Johannes SchindelinAug 24, 2020
  22. Lukas StraubAug 20, 2020
  23. Jeff KingAug 20, 2020
  24. Lukas StraubAug 19, 2020
  25. Lukas StraubAug 19, 2020
  26. Randall S. BeckerAug 19, 2020
  27. Lukas StraubAug 20, 2020

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.