Hello. Right now adding checksum manually is not so bad, but with 10 or moder modules is just a pain in the ass and is a pity that the whole installation relays in manual copy/paste. Could it be automatically added? Thank you!
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | plugin_manager_md5_iframe.patch | 772 bytes | jabapyth |
| #13 | plugin_manager_patch_iframe.png | 101.07 KB | jabapyth |
Comments
Comment #1
Anonymous (not verified) commentedI certainly willing to do this if a proper way can be found. In a previous discussion (that I'm afraid I don't have the URL for) someone pointed out that if the server fills in the md5, it could fall victim to a man in the middle attack. The client could probably attempt to get the md5 directly from the d.o server and fill it in using ajax. Unfortunately I have no experience with ajax. Any ideas or suggestions on this?
Comment #2
daniorama commentedMaybe it could create a pop out with a copy of all the md5s so we could copy them all together once to a field, and not one for each...
I think the best way could be 3 checkboxes: individual md5s, group md5 or ignore md5, so the admin choose the best way to include them...
Comment #3
gregglesIndeed the problem with pre-filling md5 is that the module then becomes vulnerable to DNS poisoning attacks. Allowing an admin to say "don't worry about md5" could be interesting, but it's also a bit of a security weakness and I'm not sure it's that great of an idea.
Another solution would be to use https when downloading the files, though I think that the fact that drupal.org uses a self-signed SSL certificates wouldn't work very well for that.
Comment #4
kbahey commentedI am inclined to mark this as "by design" (yes, we want it to be a bit manual so as not to make things too vulnerable) or "postponed" (an alternative design/future solution may be considered)
Comment #5
fletchgqc commenteddrupal.org is being redesigned. Perhaps they will splash out on an SSL cert? That would be cool and solve the issue I guess. So I would say postpone until then.
What an interesting discussion though. I would bet that if you could take statistics you would discover that 99% of packages downloaded from drupal don't have their MD5 sum verified. Now we want to enforce it for people using this module. However I also understand if you say "we shouldn't be insecure just because everyone else is insecure."
A lot of open source software runs on a principal something like "secure by default, opportunity to make it as insecure as you want" which I quite like. But in the end I believe we owe a lot to those writing the module and they can make whatever decisions they like, the rest of us have to be grateful for what we've got.
EDIT: Actually now that I think about it - I'm not sure how downloading over HTTPS via PHP works but in SSL theory, as long as you know which certificate you should be presented with it doesn't matter whether it's self-signed or not. It's like a pre-shared key. What I mean is, I can create a self-signed certificate for drupal.org, I keep the private key and give you the public key over a secure channel. The fact that it's not signed by a real CA doesn't matter. You code the public key into the module and the module simply checks the public key is correct when it connects.
Comment #6
jabapyth commentedI see two potential solutions to this problem. One, is to use an iframe (for the project page), and still have the user copy/paste the checksum. This would significantly reduce the tedium, but not completely, while retaining all of its security.
The other is to use AJAX (as was mentioned before) to grab the checksum (a patch for which I could easily code), which would *completely* remove the tedium -- the user would just need to wait the few seconds while the AJAX loads.
I believe this second way would be best, and I don't think it would be any less secure.
Can anyone see potential vulnerabilities in the second solution?
Comment #7
Anonymous (not verified) commentedI love the AJAX solution. In fact, I've been wanting to add that since the beginning of the project. There was just one slight detail that has been getting in my way: I don't know how to write AJAX. :P If you're willing to write the patch, I am definitely willing to commit it.
There is an XML feed available at http://updates.drupal.org/release-history/project_name/api_version (such as http://updates.drupal.org/release-history/plugin_manager/6.x) that contains the MD5 sum, along with several other details. That might be useful for you.
EDIT:
(Wow, that was a typo I made!)
Comment #8
kbahey commentedWhat about DNS cache poisioning? This was the main reason we mandated manual entry of the checksum.
AJAX would still be vulnerable to that, right?
Comment #9
Anonymous (not verified) commentedSince the AJAX would actually be run on the client's side, it shouldn't be any more insecure than the client loading the appropriate page from Drupal.org and manually copying the md5. If the client has been compromised, both methods will return compromised results. If the client has not been compromised, both methods will return proper results. Since the browser is the one that would be making the AJAX request, I believe that both methods are equal in security.
Comment #10
jabapyth commentedNow that I think about it, AJAX probably wont work for this. Currently, AJAX requires that the requests are made to the same domain, but we want to get data from drupal.org. Now there are two fixes for this:
We grab the page serverside and serve it up unchanged to our AJAX to parse (which I believe is subject to the security problems outlined above)
Drupal implements JSON on up updates.drupal.org (which gets around AJAX's same-domain restriction.
This second one would be ideal, but I'm not sure how likely it is to happen (though I believe it would be relatively simple for them to do......)
So for the time being, iframes are probably the best way to go.
Meanwhile, how do we convince updates.drupal.org to implement JSON?
Comment #11
fletchgqc commentedContinuing the SSL idea... from my short research it seems you need to use libcurl to check security certs. There's a bit of code here where the guy uses this:
In the case of drupal.org, I think it's using a cert signed by cacert.org. You just have to include the public key file available here http://www.cacert.org/index.php?id=3 in your module and reference it in the third line of the above code and you can be certain that you are talking to drupal.org (DNS cache poisoning not possible).
That's the technical side. I don't know about the architectural issues, like whether introducing dependencies on libcurl is acceptable.
Comment #12
jabapyth commentedhow standard is libcurl?
And also, we can detect libcurl and get the checksums automatically if it's there, and manually if it's not.
Comment #13
jabapyth commentedHeres a little patch to add an iframe above each md5sum input on install page 2 -- which i think is a great improvement over the current situation. Now, if I can get the ajax thing working, or maybe the SSL, this will become unneeded, but I think for the moment it would greatly improve the interface.
Attached are the patch and a screenshot.
Comment #14
gregglesThat looks like a good compromise to me. It makes the interface quite busy, but on the other hand it involves many fewer pages/tabs/clicks which makes it easier - especially for people who are uncomfortable with tabs.
Comment #15
jabapyth commentedSo, I've committed the iframe patch, which is currently the best solution available. If anyone thinks of a better way to do it, feel free to let me know.
Comment #16
fletchgqc commentedIn answer to #12 - I installed the home module yesterday and (co-incidentally) I discovered that it required libcurl (without stating that explicitly in any doco - it just complained about its absence and fell over).
I just had to go into php.ini and uncomment the line where it is enabled. (XAMPP on windows). So that was simple. I'm sure you'd be able to auto-detect it... phpinfo() does something like this.
Comment #17
jwuk commented"I just had to go into php.ini..." is fine on your own server but may be a problem on hosting. Could libcurl be optional?
Comment #18
kbahey commentedI maintain a module that required it in the past (currency exchange), and changed it over to use drupal_http_request() which has more chance of working on more hosts. curl will not be available in all installation.
We can do something like this:
Comment #19
jabapyth commentedall this libcurl stuff is still hypothetical, b/c drupal doesn't have https, right?
Comment #20
kbahey commentedYes, drupal.org does not have a proper SSL certificate.
But, still, even if it did, requiring curl would make for one more added dependency.
Let us discuss this in a new issue, since this one is marked as fixed, and it is about iframes.
Comment #21
gregglesd.o has a certificate, just that it is not signed by a widely used root certificate.
Try https://drupal.org/node/292920 - it works.
Plus, if we needed a widely accepted cert for something like this we could get it.
Comment #22
jabapyth commentedthe problem w/ not having a *signed* cert, is Plugin Manager will have no way of verifying that d.o is who it says it is. The purpose of getting the md5sums via ssl is to prevent middleman attacks.
If drupal.org got certified, then we might well be able to remove this (somewhat annoying) step of getting md5sums
Comment #23
fletchgqc commentedWell... do you use SSH? Do you consider it secure? It's actually a lot less secure that using HTTPS to contact drupal.org.
SSH has no checking of certificates against any authority. The only check is to make sure that the certificate presented this time is the same as the one that was presented last time. That's what the message is about the first time you SSH into a host, something like "Do you want to connect to this host?" Then "Caching this host's fingerprint". Your computer just remembers the certificate to check that it's the same next time. I could be the man-in-the-middle on every single SSH connection you make to a certain server and you would never know.
HTTPS on drupal.org is on the other hand far more secure. drupal.org uses an SSL certificate signed by cacert.org. If you trust cacert.org, then you can trust that you are talking to drupal.org when you go to https://drupal.org. There is no chance for "man in the middle".
It's easy to mistakenly believe that drupal.org has an invalid or non-functioning security certificate, because if you visit it in your browser, your browser says something like: "drupal.org uses an invalid security certificate. The certificate is not trusted because the issuer certificate is not trusted."
However you will discover the truth if you read between the lines. The company that produced your browser decided to trust certain root certification authorities, like "Verisign", so any certificate that Verisign signs is automatically accepted by your browser. The company that produced your browser did not decide to trust "cacert.org", which signed the drupal.org certificate. That's why you get the error. However, if we choose to trust cacert.org then we can put their public key in the module and we have 100% assurance that we are really talking to drupal.org.
Summary: Drupal uses a totally valid SSL certificate. To the extent that you trust cacert.org, you can trust that https://drupal.org is secure. I think that cacert.org is worthy of our trust. Therefore, we can use HTTPS in a fully secure manner.
Comment #24
Anonymous (not verified) commentedSSH in this module is only used to install the module, usually with connection to localhost.
Comment #25
jabapyth commentedawesome. Ill start working on a patch to use ssl/curl if its available.
Comment #26
Anonymous (not verified) commentedSince this thread is dedicated to the "checksum iframe", I suggest that we continue this conversation in its own thread (a.k.a., one that hasn't already been marked as fixed.) :P
Thanks.
Comment #27
fletchgqc commentedOK, have opened a new thread here: #312414: Use HTTPS to download packages.
By the way, in response to #24 I wasn't really attempting to discuss or criticise the use of SSH in the module, rather to use SSH as an general example to explain my point, because most people consider SSH to be very secure.
Comment #28
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.