Live data from Hacker News

Git: Malicious repositories can execute remote code while cloning

openwall.com

161–170 of 228 posts

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

#161
post #81

Earlier quoted context omitted.

I can never remember what they are, though. To avoid this problem, I think I wrote them down on a post-it, but I had too many post-its on my desk so I got rid of them all, and now I can't remember.

The two most difficult ones are naming things, cache invalidation, and off-by-one errors. HTH. ;)

They are likely making a joke about caching the answer

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

#163
post #17

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

It's amazing how often exploits come down to optimizations. The general form being "the domain logic is X, and is secure, but we faked around it in this one case to make it faster, and it turns out we made a bad assumption while doing so". Meltdown fits this description too.

Optimizations come from making assumptions, and bugs come from mistaken assumptions.

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

#164
post #79

Earlier quoted context omitted.

Wait for a macOS security update that includes it. If you don’t want to wait, macports and homebrew will both be patched much faster.

Isn't git distributed with the Xcode command line tools?

Yes, so you’ll probably get a new version when 12.5 drops (maybe later this month?)

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

#165
post #83

Earlier quoted context omitted.

> wrote them down on a post-it You write it on local media and kept it on-premises? Cloud is the new thing, I hear.

The Post-it was but a cache.

I would consider the Post-it as persistent storage or the backup. Your memory would be the cache :D

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

#167
post #157

Earlier quoted context omitted.

Hope That Help, HTH.

"Hope this helps" I see it with HAND "have a nice day" too

I've always read it as "Happy To Help".

I see that's wrong, but ignorance has made the internet seem just that little bit warmer all these years!

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

#168
post #81

Earlier quoted context omitted.

I can never remember what they are, though. To avoid this problem, I think I wrote them down on a post-it, but I had too many post-its on my desk so I got rid of them all, and now I can't remember.

The two most difficult ones are naming things, cache invalidation, and off-by-one errors. HTH. ;)

I prefer the ordered version.

three most difficult things in CS:

2) Naming Things

1) Cache Invalidation

4) off by one errors

3) Concurrency

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

#169
post #128

Earlier quoted context omitted.

Difficult problems in programming: (1) cache invalidation (2) off-by-one errors

Fortunately, many off-by-one errors can be caught with more ergonomic tooling. For the simplest example: compare the old C-style for loop vs a Python style for-each loop.

I don't find I ever make off-by-one errors with simple collection iteration; at some point "i Oh, and slicing. I will never get Python slicing right the first time. The fact that the range is [begin, end) is just never the way I expect it to work.

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

#170
post #93

Earlier quoted context omitted.

well played. I think that just got added to my standard vocabulary. Caching has caused more errors and bugs that I've had to deal with than I can recall. My favorite was an off by one error where we returned nicely cached info -- just for the previous user who came through our system! :facepalm: That was a bad one.

That's because essentially, "state" and "caching" are the same thing on some level. And the problem with state is that you have to make sure all your state transitions don't cause bugs. What we know as a "cache" is essentially creating new state representing existing state, with all new transitions...

I like to look at caching as a form of denormalization - introducing redundancy to improve performance. And whenever we have redundancy, we have to make sure all our copies are synchronized, which can be tricky, especially in a concurrent environment.

On the other hand, the whole point of normalization in databases is to avoid redundancy and have "single source of truth".

I find the concepts of normalization and denormalization applicable and helpful outside databases as well, though a different terminology is often used.

Post reply on HN