Nextcloud Server
Go to file
Lukas Reschke c0a02f1615 Verify CSRF token already in update.php and not the EventSource code
Issue report:
> Hum, well I upgraded the package then visited the web interface to
trigger the update and it failed; the UI would say there was a
possible CSRF attack and after that it'd be stuck in maintenance mode.
Tried a few times (by editing maintenance to false in owncloud.conf)
and same result each time.

That smells partially like an issue caused by our EventSource implementation, due to legacy concerns the CSRF verification happens within the EventSource handling and not when the actual endpoint is called, what happens here then is:

1. User has somehow an invalid CSRF token in session (or none at all)
2. User clicks the update button
3. Invalid CSRF token is sent to update.php - no CSRF check there => Instance gets set in maintenance mode
4. Invalid CSRF token is processed by the EventSource code => Code Execution is stopped and ownCloud is stuck in maintenance mode

I have a work-around for this problem, basically it verifies the CSRF token already in step 3 and cancels execution then. The same error will be shown to the user however he can work around it by refreshing the page – as stated by the error. I think that’s an acceptable behaviour for now: INSERT LINK

To verify this test:

1. Delete your ownCloud cookies
2. Increment the version in version.php
3. Try to upgrade
=> Before the patch: Instance shows an error, is set to upgrade mode and a refresh does not help
=> After the patch: Instance shows an error, a refresh helps though.

This is not really the best fix as a better solution would be to catch such situations when bootstrapping ownCloud, however, I don’t dare to touch base.php for this sake only, you never know what breaks then…

That said: There might be other bugs as well, especially the stacktrace is somewhat confusing but then again it installing ownCloud under /usr/share/owncloud/ and I bet that is part of the whole issue ;-)
2015-03-09 10:07:30 +01:00
.idea
3rdparty@322e9ce44a update 3rdparty to current master 2015-02-26 15:11:03 +01:00
apps Merge pull request #14706 from owncloud/ldap-reset-paged-search-on-null-limit 2015-03-09 08:12:25 +01:00
build Make sure we use Jasmine 2 for running JS unit tests 2015-03-04 13:50:59 +01:00
config Refactor \OC\Memcache\Factory 2015-03-05 11:36:34 +00:00
core Verify CSRF token already in update.php and not the EventSource code 2015-03-09 10:07:30 +01:00
l10n Correctly create the expected key for plurals with quotes 2015-02-18 13:22:06 +01:00
lib [tx-robot] updated from transifex 2015-03-09 01:54:36 -04:00
ocs Revert "Updating license headers" 2015-02-26 11:37:37 +01:00
settings [tx-robot] updated from transifex 2015-03-09 01:54:36 -04:00
tests Merge pull request #13368 from owncloud/memcache_lowlatency 2015-03-05 13:05:17 +01:00
themes
.bowerrc
.gitignore
.gitmodules
.htaccess Let users configure security headers in their Webserver 2015-03-02 19:07:46 +01:00
.jshintrc
.mailmap Adding .mailmap - helps to add unified authors to the license header 2015-02-22 20:36:36 +00:00
.scrutinizer.yml
.tag
.user.ini Use "off" and "off" instead of true booleans 2015-02-23 09:40:15 +01:00
AUTHORS
autotest-external.sh fix files external test run and add common-tests option 2015-02-26 13:32:44 +01:00
autotest-hhvm.sh
autotest-js.sh
autotest.cmd
autotest.sh
bower.json
buildjsdocs.sh
console.php Don't swallow errors in console.php 2015-02-28 12:31:11 +01:00
CONTRIBUTING.md add documentation issue trackers and use https everywhere 2015-02-18 19:13:49 +01:00
COPYING-AGPL
COPYING-README
cron.php Revert "Updating license headers" 2015-02-26 11:37:37 +01:00
db_structure.xml set max argument length to 4000 2015-02-25 15:09:41 +01:00
index.html
index.php Revert "Updating license headers" 2015-02-26 11:37:37 +01:00
indie.json
issue_template.md Merge pull request #10830 from Finkregh/patch-1 2015-02-24 12:13:55 +01:00
occ
public.php Revert "Updating license headers" 2015-02-26 11:37:37 +01:00
README.md Adding dependency labels 2015-03-02 20:56:35 +01:00
remote.php Revert "Updating license headers" 2015-02-26 11:37:37 +01:00
robots.txt
status.php Revert "Updating license headers" 2015-02-26 11:37:37 +01:00
version.php This is not 8.1 pre alpha 2015-02-28 00:26:31 +01:00

ownCloud

ownCloud gives you freedom and control over your own data. A personal cloud which runs on your own server.

Build Status on Jenkins CI

Git master: Build Status

Quality:

  • Scrutinizer: Scrutinizer Quality Score
  • CodeClimate: Code Climate

Depencencies:

Dependency Status

Dependency Status

Installation instructions

https://doc.owncloud.org/server/8.0/developer_manual/app/index.html

Contribution Guidelines

https://owncloud.org/contribute/

Get in touch

Important notice on translations

Please submit translations via Transifex: https://www.transifex.com/projects/p/owncloud/

Transifex

For more detailed information about translations: http://doc.owncloud.org/server/8.0/developer_manual/core/translation.html