From: Junio C Hamano <hidden> Date: 2016-06-15 22:52:18
Jeff King [off-list ref] writes:
And nothing shows up in the body, because git truncates at the NUL we
added:
$ git show
commit 31337a1093af2d97eb2e6c08b261c2946395fdd3
Author: Jeff King [off-list ref]
Date: Wed Oct 19 15:34:00 2011 -0400
10
diff --git a/file b/file
But you cannot hide from "cat-file commit" ;-)
With the recent push to more (perceived) security, it may probably make
sense to teach "log" family commands to quote-show ^@ and what is behind
in their output by default, perhaps with an option to turn it off.
From: Jeff King <hidden> Date: 2016-06-15 22:52:18
On Wed, Oct 19, 2011 at 09:31:16PM -0700, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
And nothing shows up in the body, because git truncates at the NUL we
added:
$ git show
commit 31337a1093af2d97eb2e6c08b261c2946395fdd3
Author: Jeff King [off-list ref]
Date: Wed Oct 19 15:34:00 2011 -0400
10
diff --git a/file b/file
But you cannot hide from "cat-file commit" ;-)
Yes. The implementation is a horrible hack, second only in grossness to
the original idea. :)
With the recent push to more (perceived) security, it may probably make
sense to teach "log" family commands to quote-show ^@ and what is behind
in their output by default, perhaps with an option to turn it off.
Agreed. Having hidden cruft makes birthday collision attacks easier (or
it will, if sha1 ever gets broken to that point). Unfortunately, there
is a _ton_ of code which assumes that commit messages are
NUL-terminated, as they always have been since e871b64 (2005-05-25).
-Peff
On Thu, Oct 20, 2011 at 3:31 PM, Junio C Hamano [off-list ref] wrote:
Jeff King [off-list ref] writes:
quoted
And nothing shows up in the body, because git truncates at the NUL we
added:
$ git show
commit 31337a1093af2d97eb2e6c08b261c2946395fdd3
Author: Jeff King [off-list ref]
Date: Wed Oct 19 15:34:00 2011 -0400
10
diff --git a/file b/file
But you cannot hide from "cat-file commit" ;-)
With the recent push to more (perceived) security, it may probably make
sense to teach "log" family commands to quote-show ^@ and what is behind
in their output by default, perhaps with an option to turn it off.
What about NUL in file name in tree objects? Suppose the original tree
has an entry named "goodthing". With luck, they might be able to
create a new tree object with the entry renamed to "evil\x001234" that
has the same SHA-1. Could that possibly cause any problems?
--
Duy
From: Jeff King <hidden> Date: 2016-06-15 22:52:18
On Thu, Oct 20, 2011 at 08:14:56PM +1100, Nguyen Thai Ngoc Duy wrote:
quoted
But you cannot hide from "cat-file commit" ;-)
With the recent push to more (perceived) security, it may probably make
sense to teach "log" family commands to quote-show ^@ and what is behind
in their output by default, perhaps with an option to turn it off.
What about NUL in file name in tree objects? Suppose the original tree
has an entry named "goodthing". With luck, they might be able to
create a new tree object with the entry renamed to "evil\x001234" that
has the same SHA-1. Could that possibly cause any problems?
NUL is already meaningful in a tree object; it is the end of the
filename. So after the NUL, we will consider the next 20 bytes to be
sha1, and then after that, the mode of the next file entry.
-Peff