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

Re: [RFC] tag-ref and tag object binding

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Jan 26, 2016, 09:35 UTC
Message-ID
<56A73DE6.5050201@drmicha.warpmail.net>
In-Reply-To
<20160125212208.GB26169@LykOS>
Santiago Torres venit, vidit, dixit 25.01.2016 22:22:
Show 29 quoted lines
> Hello everyone.
> 
> I've done some further research on the security properties of git
> metadata and I think I've identified something that might be worth
> discussing. In this case, The issue is related to the refs that point to
> git tag objects. Specifically, the "loose" nature of tag refs might
> possibly trick people into installing the wrong revision (version?) of a
> file.
> 
> To elaborate, the ref of a tag object can be moved around in the same
> way a branch can be moved around (either manually or by using git
> commands). If someone with write access can modify where this ref points
> to, and points it to another valid tag (e.g., an older, vulnerable
> version), then many tools that work under the assumption of static tags
> might mistakenly install/pull the wrong reivision of source code. I've
> verified that this is possible to pull off in package managers such as
> PIP, rubygems, gradle(maven), as well as git submodules tracking tags.
> 
> In order to stay loyal to the way files in the .git directory are
> ordered, I don't think that making the ref file (or packed refs) files
> differently is an option. However, I think that it could be possible to
> store the "origin ref" in the git tag object, so tools can verify that
> they are looking at the appropriate tag. There might also be a simpler
> solution to this, and I would appreciate any feedback.
> 
> What do you guys think?
> 
> Thanks!
> Santiago.

If you cannot trust those with write access to a repo that you are pulling and installing from you might want to re-check where you are pulling or installing from ;)

In fact, just like you shouldn't blindly download and install a tarball (but check its signature) you shouldn't blindly pull and install from a repo.

Your best bet is checking the signature of signed tags. Now, if you're worried about someone maliciously pointing you to the wrong, correctly signed tag then you should verify that the tag object contains the tag "name" that you expect (for example by using "git verify-tag -v" or "git cat-file -p"), since that is part of the signed content.

Michael
Previous: Santiago TorresNext: Santiago Torres
Message 2 of 17 in “[RFC] tag-ref and tag object binding”
  1. Santiago TorresJan 25, 2016
  2. Michael J GruberJan 26, 2016
  3. Santiago TorresJan 26, 2016
  4. Jeff KingJan 26, 2016
  5. Junio C HamanoJan 26, 2016
  6. Santiago TorresJan 28, 2016
  7. Santiago TorresJan 26, 2016
  8. Junio C HamanoJan 26, 2016
  9. Michael J GruberJan 27, 2016
  10. Jeff KingJan 27, 2016
  11. Michael J GruberJan 27, 2016
  12. Jeff KingJan 27, 2016
  13. Michael J GruberJan 27, 2016
  14. Junio C HamanoJan 27, 2016
  15. Michael J GruberJan 27, 2016
  16. Jeff KingJan 27, 2016
  17. Santiago TorresJan 28, 2016

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.