All of lore.kernel.org
 help / color / mirror / Atom feed
* check_refname_format allows refs with components that begin with -, even though `git tag` does not
@ 2020-11-10 19:32 Demi M. Obenour
  2020-11-10 20:09 ` Junio C Hamano
  2020-11-10 21:33 ` check_refname_format allows refs with components that begin with -, even though `git tag` does not Ævar Arnfjörð Bjarmason
  0 siblings, 2 replies; 10+ messages in thread
From: Demi M. Obenour @ 2020-11-10 19:32 UTC (permalink / raw)
  To: Git


[-- Attachment #1.1.1: Type: text/plain, Size: 927 bytes --]

If I try to create a Git tag with a name beginning with `-`,
Git complains.  However, Git does not check that a repository does
not have tags containing `-`.  This almost led to a vulnerability
in the QubesOS `verify-git-tag` script.  Fortunately, this was not
exploitable, as neither `git tag -v`, `git verify-tag --raw`, nor
`git describe` have options that are useful to an attacker.

Since this could cause vulnerabilities in other programs, I initially
reported it as an embargoed security bug, but was told to post it
publicly.

The best idea I had for a fix is to print names beginning with `-`
using the fully-qualified form, such as "refs/tags/-a".  Also, `--`
is used as a delimiter in many commands, and can’t be escaped,
so disallowing it might be a good idea.

In the long run, I hope to see leading dashes banned entirely, but
backwards compatibility might prevent that.

Sincerely,

Demi

[-- Attachment #1.1.2: OpenPGP_0xB288B55FFF9C22C1.asc --]
[-- Type: application/pgp-keys, Size: 4041 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-11-11  2:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-10 19:32 check_refname_format allows refs with components that begin with -, even though `git tag` does not Demi M. Obenour
2020-11-10 20:09 ` Junio C Hamano
2020-11-10 21:35   ` Jeff King
2020-11-10 21:37     ` [PATCH 1/3] rev-parse: don't accept options after dashdash Jeff King
2020-11-10 21:38     ` [PATCH 2/3] rev-parse: put all options under the "-" check Jeff King
2020-11-10 21:40     ` [PATCH 3/3] rev-parse: handle --end-of-options Jeff King
2020-11-10 22:23       ` Junio C Hamano
2020-11-10 22:28         ` Demi M. Obenour
2020-11-11  2:22         ` Jeff King
2020-11-10 21:33 ` check_refname_format allows refs with components that begin with -, even though `git tag` does not Ævar Arnfjörð Bjarmason

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.