Closed m-o-e closed 9 years ago
Rubygems.org is down. People can still get code manually from repositories, or download directly some gems stored somewhere, but how could they do that safely?
A small variation on Scenarios 1 and 2. An attacker could compromise a gem and merely remove the signature data. Any signing solution would need to warn the user if a signature is missing, or a previously installed signed-gem is updated with an unsigned version.
I'll point out something in the Scenario 2: information leaks. Even if someone is not tampering with the packets, knowing which gems someone is downloading can give useful indications like "Company X is using an old and vulnerable gem". This can be fixed with SSL for most cases, but can be disastrous in the case of a rubygems.org compromise.
In the case of CA: what happens if a ruby distributor (Centos, say) is hacked and changes the CA key list? When would we find out? Also, recall Debian's track record of deploying an unmodified version of rubygems, and wonder if they wouldn't set up their own CA.
A few attack scenarios that any proposed scheme will have to deal with.
It would be nice if each proposal could add a short paragraph to explain how the scheme behaves in each scenario.
Please add corrections/additions to the scenarios in the comments.
Scenario 1: rubygems.org compromised, Gem modified
Rubygems.org is hacked. Attacker modifies rails-3.0.0.gem on-disk. When and how is it detected, by whom?
Scenario 2: Network MITM
Your network is untrusted. The attacker can direct your DNS lookups and connections anywhere.
You still want to install rails-3.0.0.gem with confidence that it originated from 37signals (or abort if that's not possible).
How is this ensured?
Scenario 3: 37signals signing key and credentials are stolen
The attacker can now sign and push gems as 37signals. They must stop it (revoke key?): How?
Scenario 4: Denial of Service
Rubygems.org is down. People can still get code manually from repositories, or download directly some gems stored somewhere, but how can they do that safely?