> So far found in projects including: crypto, golang, python, js, bash, docker, k8s Huh? What does that mean?
The author is being obtuse. They mean that clones have been made of those projects that include malicious code. It's like if I make a copy of the New York Times website but replace the cover image with nudity and put it on a different URL and someone tweets "omg NYT has nudity on the front page" and clarifies, vaguely, 10 tweets down that it was actually not the real NYT but a clone. I'm not convinced that the author…
Malicious code added to 35k GitHub repos, leaking user environments
41–50 of 79 posts
Re: Malicious code added to 35k GitHub repos, leaking user environments
#42Earlier quoted context omitted.
Here is a commit with malicious code from a Microsoft employee: https://github.com/promonlogicalis/asn1/commit/7bdca06d0edf8...
That commit was rewritten from https://github.com/Logicalis/asn1/commit/d60463189a563e49f19... which was signed, but is not in the fork.
Re: Malicious code added to 35k GitHub repos, leaking user environments
#43Earlier quoted context omitted.
I feel the commit data could be extended to include some metadata that isn’t used to compute the hash. GitHub could then make use of this data to populate whatever. (Not sure if such a field already exists in the commit blob)
> I feel the commit data could be extended to include some metadata that isn’t used to compute the hash. That's not how git works.
This design doesn’t preclude the usage of additional information in the commit blob that isn’t used to compute the hash.
(Think for example how file access times do not affect its hash)
Re: Malicious code added to 35k GitHub repos, leaking user environments
#44TL;DR: These are forks by unknown people containing malware. I see no indication in the linked thread of even a single successful compromise actually occurring, or malicious code making it into legitimate upstream projects.
Here is a commit with malicious code from a Microsoft employee: https://github.com/promonlogicalis/asn1/commit/7bdca06d0edf8...
Re: Malicious code added to 35k GitHub repos, leaking user environments
#45Earlier quoted context omitted.
> I feel the commit data could be extended to include some metadata that isn’t used to compute the hash. That's not how git works.
I’m somewhat familiar with how git works. In my understanding, a commit is just a blob combining the commit information and a tree blob, hashing them together to create a commit id. This design doesn’t preclude the usage of additional information in the commit blob that isn’t used to compute the hash. (Think for example how file access times do not affect its hash)
Re: Malicious code added to 35k GitHub repos, leaking user environments
#46How would code like this make it into so many repos? People accepting pull requests and not properly reviewing them? Or is there something even worse about this attack?
Many of the repos I found were clones of valid projects with same names under new orgs and new users. For instance, this projects is valid: https://github.com/scala-network/GUI-miner and it's infected clone: https://github.com/stellitecoin/gui-miner GPG signed commits by the legitimate users do not contain the malware
Re: Malicious code added to 35k GitHub repos, leaking user environments
#47Earlier quoted context omitted.
Correct. My suggestion for a solution is for github to add a "reject-unsigned" feature. Only allow commits signed by and to be pushed to github, under any projects/org.
Let me ask a few questions about this scheme: 1. What happens when someone needs to resolve a merge conflict involving your commit? Let's say I maintain a fork of an open source repo to add some feature, and I periodically merge back in upstream changes... that necessarily involves resolving conflicts. By default, git retains author ownership, and now the commit is unsigned, but it's really your work. What do we do?…
The check is that commits at the point of merge have a valid signature. Historical commits are part of the history and as such cannot be changed without an additional commit (with a valid signature). Previous unsigned commits are deemed trusted at the point you begin signing and checking.
Squash merge breaks stuff and shouldn't be used. To complete things, the restricted set of operations exposed through the GUI should sign using gitlab's or github's key (or some accepted bot key we've set), with the check happening on the input commits, but AFAICT that's not supported yet.
Re: Malicious code added to 35k GitHub repos, leaking user environments
#48> The attacker creates FAKE orgs/repos and pushes clones of LEGIT projects to github.
Yeah, anyone can push anything to their own GitHub accounts/orgs, including malware. We know that.
Save yourself some time. Flagged.
Re: Malicious code added to 35k GitHub repos, leaking user environments
#49Oh dear. This is a gigantic disaster. If lots of software released today haven't been pinning their versions on release (especially Electron apps) or signing their commits if they are open-source, then this is a chaotic supply chain attack waiting to happen and is more worse than I thought. But really it is yet, another reason to avoid GitHub entirely and just self-host using GitLab or Gitea.
You may have misunderstood (understandably, because the tweets seem to be deliberately misleading). These are malicious commits in forks of repositories. There is no supply chain attack unless you make a habit of taking random forks of popular projects from GitHub and inserting them into your supply chain.
Actually yes, this is all about supply chain attacks. Typosquatting is one of the most common methods. It goes under this category.
Re: Malicious code added to 35k GitHub repos, leaking user environments
#50Somebody should DDoS ovz1.j19544519.pr46m.vps.myjino.ru... (mostly kidding)
j19544519 - seems to be the username on this hosting.