Live data from Hacker News

Malicious code added to 35k GitHub repos, leaking user environments

twitter.com

11–20 of 79 posts

Re: Malicious code added to 35k GitHub repos, leaking user environments

#11
post #7

This is that thing where people can put anyone in as the commit author, thus impersonating the original creator right? Seems like the solution is "don't just copy random github urls into your code" ?

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.

How does this solution solve the problem?

You're just adding an extra step that's hardly going to stop someone.

Re: Malicious code added to 35k GitHub repos, leaking user environments

#13

Earlier 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.

How does this solution solve the problem? You're just adding an extra step that's hardly going to stop someone.

It would only allow commits signed by me to be pushed under my email. Github uses the email as the "proof" of commit ownership. By only accepting signed commits a user would not be able to push a commit impersonating me.

Re: Malicious code added to 35k GitHub repos, leaking user environments

#15
post #7

This is that thing where people can put anyone in as the commit author, thus impersonating the original creator right? Seems like the solution is "don't just copy random github urls into your code" ?

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.

How would that work for past commits? Would people be forbidden to mirror a project to git just because it contains an unsigned commit of mine from 2007?

Re: Malicious code added to 35k GitHub repos, leaking user environments

#16
post #4

How 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?

Most of them don't seem to come from pull requests, I wonder if it's paired with a bunch of compromised github accounts?

Not compromised, just created by the attacker.

Re: Malicious code added to 35k GitHub repos, leaking user environments

#17
post #7

This is that thing where people can put anyone in as the commit author, thus impersonating the original creator right? Seems like the solution is "don't just copy random github urls into your code" ?

This is also a problem for enterprises. I’ve seen commits from root, ec2-user, etc: GitHub knows who’s pushing a commit even if git doesn’t, and it’s maddening that at least for enterprise accounts they don’t carry that identity into the metadata.

Re: Malicious code added to 35k GitHub repos, leaking user environments

#18
post #7

This is that thing where people can put anyone in as the commit author, thus impersonating the original creator right? Seems like the solution is "don't just copy random github urls into your code" ?

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? Do I have to use a custom merge flow that also rewrites authorship from "Alice " to "Alice "?

2. What happens if your gpg key is compromised or expires? Are all your previous repos now invalid? I can't fork it because it contains a commit authored by you, but with a revoked or expired gpg key?

3. What happens to previous commits if I enable this feature? Can all my unsigned commits no longer be pushed to github? I made a commit in a project at work 5 years ago with my email, but didn't sign it.. if that company wants to open source that project on github, do they now have to rewrite history to change the author on my unsigned commits?

4. What does the "squash merge" button on github PRs do for your PRs?

Re: Malicious code added to 35k GitHub repos, leaking user environments

#19
post #14

Somebody should DDoS ovz1.j19544519.pr46m.vps.myjino.ru... (mostly kidding)

I admire the desire to help, but looking at flow logs to that IP address is how people are going to determine if they have compromises in their environments. Excess traffic to the IP will just muddy the water.
Post reply on HN