Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harden get url content for apps own cloud com #9473

Closed
wants to merge 2 commits into from

Conversation

georgehrke
Copy link
Contributor

fixes #9054
@LukasReschke please take a look

@@ -17,9 +17,10 @@ class AppHelper implements \OCP\IHelper {
* Gets the content of an URL by using CURL or a fallback if it is not
* installed
* @param string $url the url that should be fetched
* @param bool $verifyCert Whether the SSL certificate should get verified (defaults to yes)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defaults to yes => defaults to false

@georgehrke
Copy link
Contributor Author

@LukasReschke Is this ready to go when we add the public crt?

@LukasReschke
Copy link
Member

Is this ready to go when we add the public crt?

Yes. I'd still appreciate some unit tests.

@DeepDiver1975
Copy link
Member

@georgehrke @LukasReschke is this PR to fix #9054 ?

@LukasReschke
Copy link
Member

Yes

* @return string the content of the webpage
*/
public function getUrlContent($url);
public function getUrlContent($url, $verifyCert);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add default - otherwise you break the api

@DeepDiver1975 DeepDiver1975 added this to the ownCloud 7 CE milestone Jul 10, 2014
@DeepDiver1975
Copy link
Member

@georgehrke can you finish this today?

@DeepDiver1975
Copy link
Member

setting milestone oc7ce

@georgehrke
Copy link
Contributor Author

I'll try, but I am in the university at least til 5pm

@DeepDiver1975
Copy link
Member

@georgehrke @LukasReschke please squash the commits - we need to backport this - thx

@DeepDiver1975
Copy link
Member

@georgehrke I'll hijack this pr then

@PVince81
Copy link
Contributor

@DeepDiver1975 DeepDiver1975 changed the title WIP: Harden get url content for apps own cloud com Harden get url content for apps own cloud com Jul 10, 2014
@DeepDiver1975
Copy link
Member

code looks good - requires testing

@georgehrke @LukasReschke @PVince81

@PVince81
Copy link
Contributor

How to test ?

@DeepDiver1975
Copy link
Member

How to test ?

I'd try to load apps from the appstore - maybe

@georgehrke @LukasReschke

@PVince81
Copy link
Contributor

Okay, I thought I'd need setting up some kind of local server with valid and invalid certificates.
Testing against the app store will only test the "valid" one. I can do that.

@LukasReschke
Copy link
Member

I'd try to load apps from the appstore - maybe

Shouldn't work as we still do not have a proper SSL certificate on api.apps.owncloud.com

@DeepDiver1975
Copy link
Member

Shouldn't work as we still do not have a proper SSL certificate on api.apps.owncloud.com

So we can test the negative scenario - better than nothing 😉

@DeepDiver1975
Copy link
Member

@georgehrke @LukeOwncloud I guess we should enable the additional option as well - right?

@georgehrke
Copy link
Contributor Author

@DeepDiver1975 which additional option?

@DeepDiver1975
Copy link
Member

@DeepDiver1975 which additional option?

the option to validate the cert in https://github.com/owncloud/core/blob/master/lib/private/ocsclient.php#L56

@MorrisJobke
Copy link
Contributor

@karlitschek @craigpg @LukasReschke I would vote that as a showstopper. Please triage this and rate it yourself.

@LukasReschke
Copy link
Member

While having proper HTTPS on the AppStore (and for updates) would be very nice and a nice addition we have to consider that HTTPS does not necessarily have the same security implications as e.g. in a regular WIFI network.

To be able to abuse this vulnerability you would need to be able to intercept (or modify the routes) to the API server. This is not something that an attacker is usually able to do on a remote server network. (he could play with BGP or spoofed DNS reply and a few other things but if an attacker is able to do this he can do you much more harm anyways)

This is therefore not a showstopper in my opinion as the real-world impact is much less than one would usually assume. However, we should certainly fix this and rate this as an important improvement, but doing TLS properly in PHP is basically a pain and may be depending on the PHP version not even possible.

I can take a look at this, but this requires me to setup a proper test environment with a lot of different PHP versions and operating systems. Most likely it will end that we try to use secure HTTPS but if it is not possible by the PHP version we will just have to fallback to "insecure" (unverified) HTTPS.

@MorrisJobke
Copy link
Contributor

@LukasReschke Thanks for the clarification.

@LukasReschke LukasReschke self-assigned this Aug 21, 2014
@karlitschek
Copy link
Contributor

Yes. This is definitely a nice to have improvement. But not a showstopper.

@craigpg craigpg modified the milestones: 2014-sprint-04-next, ownCloud 7 CE Sep 2, 2014
@craigpg craigpg modified the milestones: 2014-sprint-05-next, 2014-sprint-04-current Sep 15, 2014
@craigpg craigpg modified the milestones: 2014-sprint-06-next, 2014-sprint-05-current Sep 29, 2014
@georgehrke
Copy link
Contributor Author

is this something we want for ownCloud 8?

@craigpg craigpg modified the milestones: 2014-sprint-07-next, 2014-sprint-06-current Oct 12, 2014
@craigpg craigpg modified the milestones: 2014-sprint-08-next, 2014-sprint-07-current Oct 27, 2014
@craigpg craigpg modified the milestones: 2014-sprint-09-next, 2014-sprint-08-current Nov 10, 2014
@ghost
Copy link

ghost commented Nov 21, 2014

💣 Test FAILed. 💣
Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/3039/
💣 Test FAILed. 💣

@PVince81
Copy link
Contributor

Do we want this in OC 8 ?

@karlitschek
Copy link
Contributor

Nice to have but not urgent. Let´s focus on the features and bugs if you ask me. I will check how stable we can make our ssl server cert here so it doesn't break in a few years.

@MorrisJobke
Copy link
Contributor

@DeepDiver1975 @LukasReschke Something for 8.1?

@LukasReschke
Copy link
Member

Yes – together with #13056

@MorrisJobke MorrisJobke modified the milestones: 8.1-next, 2014-sprint-09-next Jan 9, 2015
@LukasReschke
Copy link
Member

Requires another approach then though as the server config is now less error-prone. Let's close this for now and tackle again as part of above issue.

@LukasReschke LukasReschke deleted the harden_getUrlContent_for_appsOwnCloudCom branch February 12, 2015 12:22
@lock lock bot locked as resolved and limited conversation to collaborators Aug 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve HTTPS cert validation for appstore
8 participants