-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[WIP] Allow * wildcard in trusted_domains to support unstable DNS names and unstable IP addresses #12979
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
Conversation
|
Thanks a lot for your contribution! Contributions to the core repo require a signed contributors agreement http://owncloud.org/contribute/agreement/ Alternatively you can add a comment here stating that this contribution is MIT licensed. Some more details about out pull request workflow can be found here: http://owncloud.org/code-reviews-on-github/ |
|
The inspection completed: 2 new issues, 1 updated code elements |
| @@ -110,9 +110,26 @@ public static function isTrustedDomain($domainWithPort) { | |||
| return true; | |||
| } | |||
|
|
|||
| return in_array($domain, $trustedList); | |||
| // Allow access from an explicitly listed domain | |||
| if( in_array($domain, $trustedList)) { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No space here after the (
|
Thanks for your contribution @jernst. We're using PHPUnit for our PHP unit tests, running a single test-suite is pretty straight forward:
The output will look like following if everything worked: If something failed you will pretty much notice it as it will complain - I guess that should be enough to get you started for now to adjust the unit tests? I'm kinda reluctant to add new features without having them covered by tests. Then we also have that fancy By the way, don't worry about the "Failed" sign here on GitHub our Continuous Integration (CI) system is currently somewhat buggy, that system is running our Let me know if you have any further question or require further assistance. I'd be glad to help you! :-) |
|
unit tests are required -> moving to OC8.1 |
|
I feel like this is really bad from a security POV and basically circumvents the host header poisoning prevention. Use a free service like http://www.noip.com/ to handle dynamic ips or use a VPN 👎 |
|
@Raydiation: either you enforce security in the code base to the extent that it is "impossible" to run ownCloud with anything other than maximum security (per your view, whatever that is), in which case you make it impossible for users who know what they are doing (or are willing to take the risk) to do what they want. Or you set the right secure defaults, but let people override them. I'm in favor of #2, thus this proposed patch. I do not believe that it reduces security at all, unless the user decides they want that. |
|
Agreed with @jernst - if this change is done correctly I don't mind it. There is always a compromise between usability and security. This one is fine and has certainly some reasonability behind it. (for example auto-provisoning in a fixed IP block / subdomain etc...) |
|
Requires unit tests and rebase. Otherwise we can't merge this :-( |
|
We currently do our own ownCloud patch in UBOS, it's here: https://github.com/indiebox/ubos-owncloud/blob/master/owncloud/allow-wildcard-trusted.patch. This replaces this merge request. Corresponding test is here: https://github.com/indiebox/ubos-owncloud/blob/master/owncloud/tests/OwnCloud1Test.pm but that uses the UBOS webapptest framework, not your's. I don't currently have time to get up to speed with your test infrastructure, so I don't know how to proceed. |
|
Refer to this link for build results (access rights to CI server needed): |
|
Closing due to inactivity. Feel free to reopen once unit tests have been added, see core/tests/lib/appframework/http/RequestTest.php Lines 824 to 848 in 525745c
|

I'm not quite understanding how ownCloud releases are produced from git, nor how to run the tests, and so I don't quite know how to test this. I'm hoping that a friendly soul will advise and/or merge. Thanks.
Corresponding pull requests to docs coming.