Live data from Hacker News

Git: Malicious repositories can execute remote code while cloning

openwall.com

21–30 of 228 posts

Re: Git: Malicious repositories can execute remote code while cloning

#21
post #9

Earlier quoted context omitted.

MacOS and Windows

I guess it shows that I haven't really used either of those in a long time.

macOS has defaulted to be case insensitive largely due to historical and perhaps usability reasons. You can opt to make it case sensitive (and I do, which broke Steam for several years but that also freed my time).

Re: Git: Malicious repositories can execute remote code while cloning

#22
post #3

Earlier quoted context omitted.

macOS, to name one. It appears NTFS is also vulnerable according to the posting.

Ashamed to admit (as an OSX user) that I didn't even realize the FS was case-insensitive (having migrated from years of Linux usage to a non-Linux desktop). It does a good job of hiding this from the user (filenames are still listed with cases, and bash autocompletion completes to the correct case as well)

OSX has even more annoying problem that it decomposes unicode: https://stackoverflow.com/questions/5581857/git-and-the-umla...

Many fun times trying to copy/move/remove a file and not being able to do so because the input and name stored on fs is actually different bytewise...

Seems like linux has the only sane filesystems not trying to mangle paths at all.

Re: Git: Malicious repositories can execute remote code while cloning

#24
post #3
post #2

> This vulnerability affects platforms with case-insensitive filesystems... What kind of platforms use case-insensitive filesystems?

macOS, to name one. It appears NTFS is also vulnerable according to the posting.

FYI, on MacOS, it is a property of the partition, so you can reformat and have a case-sensitive filesystem. Applications may subtly break if they weren't tested on such a filesystem, but I had used one for several years without too many issues.

Re: Git: Malicious repositories can execute remote code while cloning

#25

Earlier quoted context omitted.

Ashamed to admit (as an OSX user) that I didn't even realize the FS was case-insensitive (having migrated from years of Linux usage to a non-Linux desktop). It does a good job of hiding this from the user (filenames are still listed with cases, and bash autocompletion completes to the correct case as well)

MacOS by default uses a "case-preserving case-insensitive" filesystem, so you can create files with mixed case, but you can't create two files with the same name and different case. It's one of MacOS's more-egregious crimes against Unix. Fortunately it doesn't manifest that often, but it rears its head often enough to be a problem.

> It's one of MacOS's more-egregious crimes against Unix.

Nah. Using a file system means putting up with its semantics. HFS+ was case-insensitive; they were deploying an upgrade to millions of existing filesystems.

If you mount, say, an NFS volume, MacOS does the expected thing.

Re: Git: Malicious repositories can execute remote code while cloning

#26

Earlier quoted context omitted.

Ashamed to admit (as an OSX user) that I didn't even realize the FS was case-insensitive (having migrated from years of Linux usage to a non-Linux desktop). It does a good job of hiding this from the user (filenames are still listed with cases, and bash autocompletion completes to the correct case as well)

MacOS by default uses a "case-preserving case-insensitive" filesystem, so you can create files with mixed case, but you can't create two files with the same name and different case. It's one of MacOS's more-egregious crimes against Unix. Fortunately it doesn't manifest that often, but it rears its head often enough to be a problem.

That’s the same as Windows, but Windows enables making directories case sensitive on a directory by directory basis.

Re: Git: Malicious repositories can execute remote code while cloning

#27
post #14

This should be fixed especially for those who want to inspect the code in a repository before running it. But anyone should keep in mind that malicious repositories can do a lot of bad things after cloning, even without this bug.

If you can't clone and then verify the code, a lot of things get much harder.

Re: Git: Malicious repositories can execute remote code while cloning

#28
post #2

> This vulnerability affects platforms with case-insensitive filesystems... What kind of platforms use case-insensitive filesystems?

MacOS and Windows

In windows, the underlying ntfs is still case sensitive, and that gets made use of with the WSL 1.0 stuff.

Re: Git: Malicious repositories can execute remote code while cloning

#29
post #11
post #2

> This vulnerability affects platforms with case-insensitive filesystems... What kind of platforms use case-insensitive filesystems?

Windows. Its a notable problem with git + Windows that has gotten better over time but still leads to a lot of WTF moments. For many this event is the first time they hear that window's filesystem is case insensitive.

It is strange I haven't noticed earlier. Maybe it is just so unnatural to name files the same with different cases that I haven't tried.

Re: Git: Malicious repositories can execute remote code while cloning

#30
post #17

The commit that fixes this issue: https://github.com/gitster/git/commit/684dd4c2b414bcf648505e... (Surprise, the root cause is a cache )

Difficult problems in programming:

(1) cache invalidation

(2) off-by-one errors

Post reply on HN