405 points · by jsmith45 · 5y ago · 135 comments
EDIT: According to zerodiums charts, this would have been a payout of up to 250k$. However, I'm not quite sure what the attackers plan on cashing out on that would have been, given that the exploit would have quite obviously referenced zerodium and therefore would make the submitter the primary suspect of being the author. Maybe some APT used this "simple" format to disguise the actual power? But then again, it would be in their interest for the exploit to actually go through.
[1] https://github.com/php/php-src/commit/c730aa26bd52829a49f2ad...
[2] https://bugs.php.net/bug.php?id=78224 (only mention I found with a documented use of the parameter)
I'd say the reason it doesn't hide better is because it's specifically meant not to hide. It's burning the vulnerability that has apparently existed for almost 4 years.
So, the message "sold to zerodium, mid 2017" is there, but may not be true -- it might very well be deliberate misdirection.
The vulnerability that is of interest is the one that allowed these commits to be injected. That is what I figure was sold years ago, and was burned recently.
Would they admit if they did?
I think it's far more likely that someone tried to plant this there in order to cash out via zerodium.
Migrating accounts of PHP core developers by asking them for their username over unencrypted email? What could go wrong? A security incident already occurred, so we should be good on that front for a few years, right?
Just to make sure that someone doesn't go in and find a PHP account with recent commits, then email you with a third party github account.
> Yesterday (2021-03-28) two malicious commits were pushed to the php-src repo [1] from the names of Rasmus Lerdorf and myself.
…and ends by saying:
> We're reviewing the repositories for any corruption beyond the two referenced commits. Please contact security@php.net if you notice anything.
Are you sure that using recent commits as confirmation is a good idea?
Combine that with a spoofed/typo'd sender and you're good to go.
(Yes, this still has holes, but it's a far smaller attack surface than "hello, it's me, trust me because I say so".)
Check out https://freedom-to-tinker.com/2013/10/09/the-linux-backdoor-... for another attempt, that one at least requires careful review to notice the problem
[1] https://github.com/php/php-src/commit/c730aa26bd52829a49f2ad...
It could work if you do it in some poorly maintained extension, maybe, but that extension probably wouldn't be much used either.
Committing to release branch would be the worst way of doing it, since only RMs commit there, and RMs are those people who are going to notice if somebody commits to their branch and it's not them. Also, since releases are tagged manually, it'd not get into the release anyway, unless you somehow trick the RM into merging the change into their local repo without looking. Which they have no reason to since they created the branch and only they are supposed to commit there. So it'd require some serious trickery.
Edit: Elsewhere someone mentioned, this could have been "marketing" - to demonstrate their ability to take over accounts.
Hot take - They burned it, in a very visible way, to prove they've had access since 2017 (or whatever the investigation will reveal). A full security audit isnt very feasible.
Would force everyone to either downgrade and face known vulnerabilities, or do nothing and face high-risk unknown vulnerabilities.
Something like signing commits, and requiring all commits to be signed properly with a known key (and checking this on push and before release) would be an independent verification layer, and a more fundamental response to the compromise.
If that's what happened, then moving to Github solves nothing.
> I definitely trust GH more than myself in managing a git infrastructure securely
That's FUD, and appropriate too considering who owns Github now.
Hell, the entire thing is simple enough to just be integrated in git.
Reminds me of that Linux compromise years ago where they picked it up because the change was directly on the build box, except at least that one was hidden behind an apparent `=` vs `==` "bug" - this one has a bit less style.
<!-- git web interface version 2.11.0, (C) 2005-2006, Kay Sievers <kay.sievers@vrfy.org>, Christian Gierke -->
"'Gitweb' is a Git web interface. It is written in Perl and can be used as a CGI script, or as a mod_perl legacy script (run by ModPerl::Registry handler). It allows browsing a git repository (or a set of git repositories) using a web browser." - https://git.wiki.kernel.org/index.php/GitwebThe last commit looks to be Dec 2020: https://github.com/git/git/tree/master/gitweb
Though I don't know that this was how they got into the git server.
There's a strong possibility the vulnerability lay in their hosting setup rather than in the software application itself.
There's an argument to be made that self-hosted software that are non-trivial to configure for security have "dev ux" type security bugs, but I doubt that'd constitute a CVE. It could also be unrelated to the git-web hosting config.
The post mentions karma, there's some code here: https://github.com/php/karma/
I think the most common attacks on Github repos and groups have been on individual accounts. Which 2FA would mitigate.
- 8d743d5 Revert "Revert "Revert "[skip-ci] Fix typo"""
- 2b0f239 Revert "Revert "[skip-ci] Fix typo""
- 046827a Revert "[skip-ci] Fix typo"
- c730aa2 [skip-ci] Fix typo(Yes, there's already such a script for GitLab.)
Someone responsible for release would have to manually keep a list of keys of authorized comiters and check the repository against this list at the very least prior to a release.
Looking at these commits they say mid-2017. Without signatures any previous commit could be by the same author.
Uh, you mean the features of ... Git?
They chose to burn -very publicly- the two accounts they had access to in order to showcase that they have an in that they can use somewhere else.