7 ms·
I'd like to hear how this was discovered and who's name ended up on git blame line next to that password. I have done a malicious source code injection as part
by rdtsc 11y ago
I'd like to hear how this was discovered and who's name ended up on git blame line next to that password.
I have done a malicious source code injection as part of a network security exercise at the university. That was before git or other sane source control and I basically inserted a semi-obfuscated piece of code in the source repository, which gave our team an advantage in the game (the game was to crack and find a weakness in a protocol, but the whole machine was a target/battlefield). The clever part was first rooting the server via suid vulnerability.
I won the contest, but while doing it I thought, yeah, this shit will never work in the real world. And then this story made me remember that. That's pretty crazy.
- forgotpwtomain 11y agoGit does not give strong guarantees for authorship unless you are signing every single commit with GPG (which is only a recently available as of 1.7 or 1.8).
- nickpsecurity 11y agoI assure you it will and that's been known since Myer's landmark paper on Subversion a long time ago. Interestingly, I predicted your move in a post earlier (last para): https://news.ycombinator.com/item?id=10767504 https://news.ycombinator.com/item?id=10767504 Even university students come up with this approach. Status quo seems hopeless against nation states unless companies learn from the past and start doing high assurance at least where it counts. ;)
- rdtsc 11y agoYeah I remember it was an interesting thought process. I put so much energy into rooting the system, and after a short celebration when I got a root shell, it was a "well now what?" moment. We debated intercepting the trafic to the game server and retransmitting (a man in the middle), initially. Then I wanted to run a hidden process (with some system looking like name) that have injected java byte code into the running server to give our team an advantage, but that proved too difficult, so the idea to just change the source in the repo that the TA kept on the same machine, was kind of a boring and un-exciting conclusion. It didn't seem very clever at all and felt like giving up.
- nickpsecurity 11y agoInteresting case study. My background is high assurance security. Most attackers go for subversion there because it's powerful. You're the only one I've seen in a while to do it because it was easier. Often is if software source or config is available in a centralized place. Btw, here's the Myer's paper in 1980 that fleshed out the threat and gave the field no excuse to have no seen much of it coming: http://csrc.nist.gov/publications/history/myer80.pdf http://csrc.nist.gov/publications/history/myer80.pdf Written in era of time-sharing machines but many (most?) lessons carry over.
- gesman 11y agoSomeone crossed the border in a hurry ...
- Animats 11y ago"I'd like to hear how this was discovered and who's name ended up on git blame line next to that password." Yes. We all want to know a lot more about exactly how that got into the source code. It may take forensics and detective work to find out, but there's probably enough log info to figure it out. Pressure needs to be kept on Juniper until they disclose this. They can't be allowed to get away with claiming "it just happened somehow."
- jlgaddis 11y agoSo let's say it was the NSA who did it. You think they haven't already sent Juniper an NSL telling them to cease discussing this incident? Personally, I'll be rather surprised if we hear any more about this from Juniper than we already have.
- rdtsc 11y agoThey have a lot to lose if they keep quiet -- customers, credibility, future business, etc. What are the powers of NSL, can they be given to any entity / person / company for any reason at all and also gag them from discussion getting the NSL? What are the penalties for a company breaking the NSL silence? Jailing the CEO? NSA sending it would also reveal quite a lot and jeopardise their future operations, it seems they'd want to have plausable deniability of some sort.
- tazjin 11y agoNot sure what the penalties for disclosing an NSL are, but companies sometimes use warrant canaries[1] for this purpose. Notably the one used by Apple disappeared some time last year. [1]: https://en.wikipedia.org/wiki/Warrant_canary https://en.wikipedia.org/wiki/Warrant_canary
- cmurf 11y agoConsidering FBI is investigating, other one hand doesn't know what the other is doing, or at least if not more likely the other handticles of the U.S. (and other governments) have been depending on some versions of affected hardware for some time.
- tlrobinson 11y agoIsn't the name on the relevant "git blame" (or equivalent) line irrelevant unless the team signs commits with GPG (or equivalent)? It's trivial to forge the author.
- rdtsc 11y agogit blame was figurative, I don't even know if they use git, I basically meant the person who is responsible for injecting that line (if they ever find out). And as you said, yes, the first thing someone would do who would insert that is of course put someone else's name there.
- hexasquid 11y ago"My God, it was Edward Snowden"
- jacquesm 11y agoIf you think about it a bit longer you'll realize it can not be a single name. Yes, someone wrote this code. But then someone else reviewed it and then a third person signed off on shipping the end result. It takes (or really, it should take) more than one person at a company like Juniper to get away with a trick like this. Unless their processes are completely broken, let's for the moment assume that they are not otherwise all bets are off. Juniper is going to be scratched from a lot of POs because of this story, if it turns out they don't have a process in place to protect against stuff like this and it does not involve two people or more operating in concert to circumvent that process then they're pretty much dead.
- baby 11y agoI don't think it's necessarily true, I remember Linus saying that for Linux' kernel they used a web of trust. At one point you had to trust some people, you can't watch every updates. And he said something along the line "if you're not doing cryptography/security like this, you're doing it wrong"
- hvis 11y ago> At one point you had to trust some people, you can't watch every updates. Yes, so Linus doesn't. But his web of trust is hierarchical. In case of some malicious code making its way into the kernel, there will be a chain of trusted people that can be made accountable for it.
- jacquesm 11y agoIf you're suggesting the reviewer wrote the patch you've eliminated the developer but you still have someone higher up in the chain that needs to be totally incompetent. Even so, that's still two people, not one. Linus' web-of-trust is more like a pyramid of trust, he has a couple of lieutenants that he trusts but I highly doubt they in turn will blindly sign off on a commit on something as critical as this.
- michaelt 11y agoIf I was doing an attack like this, I'd wait for an opportunity to slip it into a huge, mundane change. For example, changing the repository from Mercurial to Git. Splitting or combining two repositories. Moving lots of files between directories. Running an autoformatter over the entire codebase. Something like that. Every code review tool I've seen there's /some/ way you can get it to highlight thousands of trivial changes. And I don't know about you, but I can't promise I'd spot 1 evil change among 1000 trivial ones.
- ctz 11y agoI think it's extremely, vanishingly unlikely that the code contains a line like this: if (strcmp(login_password, "<<< %s(un='%s') = %u") == 0) ... This feels much more like a "reflections on trusting trust"-style toolchain compromise.
- qb45 11y agoScreenOS seems to predate git (the NetScreen line is an acquisition made in 2004, according to Wikipedia). I'm not sure if the older VCSs were as tamper-proof as modern ones so the line may as well be part of the original commit which added password authentication, decade before the hack.