-
Notifications
You must be signed in to change notification settings - Fork 117
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
[BUG]: Invalid WOPI Allow list isn't communicated to the user #2685
Comments
Yes, I’m the "someone else". Issues are very probably strongly related, although my Nextcloud and Collabora instances are on separate computers (hence 127.0.0.1 is not relevant in my case). |
We are using the server method to determine the remote address https://github.com/nextcloud/server/blob/cf508c1e4730f3590b956735678413484e2c008c/lib/private/AppFramework/Http/Request.php#L584-L611 Do you run reverse proxy in front of Nextcloud? If so is that one listed in the trusted_proxies config? |
Yes, and yes, |
Can you maybe try to apply the following patch to get logging at info log level to see what the actual detected ip is and then share that together with your configured allow list? Details on how to apply a patch can be found in https://docs.nextcloud.com/server/latest/admin_manual/issues/applying_patch.html |
My allow list is as it says in the log |
Can you check if you added the allow list separated by spaces? If that is the case maybe you can set that to a comma separated list: Regardless of that we should of course either warn the admin when configuring it like that or support both. |
Yes, it is separated by spaces. Adding commas didn't work either until I deleted the space after the comma. IE:
I agree, this should at a minimum warn if it can't parse what's entered |
The problem is not solved for me. From the beginning I use commas and I also tried with one only address. I tried to apply the patch but it asks me the file to patch and the lib/Middleware/WOPIMiddleware.php doesn’t exist (actually, the directory lib/Middelware doesn’t neither). Should I create it? |
@pagiraud The linked documentation is non-obvious. I ran into that issue too, until I realized it meant to do it in the right subfolder:
More on point, I would also agree that a full fix for this issue should include a warning to the user if it's invalid |
@byteit101 Thanks for the tip!
First, I tried with my ipv4 address and the logs yielded, so I copied/pasted the address from the message to the WOPI configuration field and… still doesn’t work. Does this mean that WOPI doesn’t work with ipv6? I assure you every occurrence of "myIPv6Address" is the same. I did a search and replace to be sure. And I checked: no space in the field, neither before nor after the ip. @juliushaertl Maybe you could reopen this issue? |
For IPv6 I just checked and it seems there is a small bug if no prefix length is specified. If you just have ipv6 address in the allow list, could you try to specify that ip with appending |
Yes, that works for me! Thank you. |
Thanks for testing and confirming that. I pushed a fix and tests for it to #2696 |
For me, the WOPI allow list only works with Nextcloud instances that are on a different host than the Collabora server. Adding 127.0.0.1 and ::1 to the allow list doesn't fix this. nextcloud.log should at least say which connections, from which IP addresses it refused. Without that, I am fumbling in the dark. |
I agree, would be awesome if in the error message we would have also IP (not only domain name) |
@vasyugan The Nextcloud Office frontend apparently uses the external IP of the Collabora/WOPI backend, not the localhost IP, presumably to allow more flexibility in deployment architecture. If you add
@VPaulV The log does tell you what IP it's trying to use (set log level to 1 or less in {"reqId":"xxxxxxxxx","level":1,"time":"2023-07-06T16:03:16+00:00","remoteAddr":"<externalIP>","user":"--","app":"richdocuments","method":"GET","url":"/index.php/apps/richdocuments/wopi/files/xxxxxxxxxxxxxxxx...","message":"WOPI request denied from <externalIP> as it does not match the configured ranges: 127.0.0.1,::1","userAgent":"COOLWSD HTTP Agent 23.05.1.2","version":"26.0.3.2","data":{"app":"richdocuments"}} |
This issue is resolved for me. Thanks @juliushaertl ! |
As a separate issue, perhaps the "WOPI request denied" error message should be WARN (2) or ERROR (3) level, rather than INFO (1). |
Not sure if this is of use but I'm running AIO and I put the IP server that the AIO Image is running on. The local IP not the public IP like 192.168.1.100 |
Can't get my setup to work So far I haven't found any combinations of allow ip's that lets me access documents through Nextcloud, but if I leave the allow list empty it works. Docker on Ubuntu 22.02 This are the logs after setting it to: "127.0.0.1,172.0.0.0/8":
Any ideas? |
Solved it, had to add the servers real external IP address also, for some reason. |
As discussed in nextcloud#2685 the message s quite important when tring to fix WOIP issues. The reasoning is that something fails from the perspective of an admin and it should emit a warning. Ofc. one could argue that the deny is expected bahaviour and should therefore emit only an info. Yet I believe that it'd be beneficial overall to consider admins that struggle to correctly set this up in that case.
As discussed in nextcloud#2685 the message s quite important when tring to fix WOIP issues. The reasoning is that something fails from the perspective of an admin and it should emit a warning. Ofc. one could argue that the deny is expected bahaviour and should therefore emit only an info. Yet I believe that it'd be beneficial overall to consider admins that struggle to correctly set this up in that case. Signed-off-by: moanos <[email protected]>
Fixed across several PRs. The most recent, #3261, enhanced logged further. Closing. |
As discussed in nextcloud#2685 the message s quite important when tring to fix WOIP issues. The reasoning is that something fails from the perspective of an admin and it should emit a warning. Ofc. one could argue that the deny is expected bahaviour and should therefore emit only an info. Yet I believe that it'd be beneficial overall to consider admins that struggle to correctly set this up in that case. Signed-off-by: moanos <[email protected]>
Describe the bug
WOPI allow list is not honored. If the whitelist is not empty, all accesses to
/index.php/apps/richdocuments/wopi/files/....
from all IP addresses return a403 Forbidden
responseTo Reproduce
Steps to reproduce the behavior:
/index.php/apps/richdocuments/wopi/files/....
returns 200's/index.php/apps/richdocuments/wopi/files/....
returns 403'sConfirmed the ip addresses to add with Wireshark. Both the actual
ip.src
andhttp.x_forwarded_for
values are in the WOPI allow list of step 4.Expected behavior
Allowing 127.0.0.1 should not provide 403's to 127.0.0.1
Client details:
Server details
Operating system: Docker on Debian 11 x64
nextcloud latest 60c973f14214 8 days ago 1.02GB
Web server: Apache 2.4
Database: Postgres
PHP version: PHP 8.1.13
Nextcloud version: 25.0.2
Version of the richdocuments app 7.0.2
Version of Collabora Online collabora/code latest 27ebaa6d94c9 3 weeks ago 1.54GB
Logs
Nextcloud log (data/nextcloud.log)
Someone else has run into this too: https://help.nextcloud.com/t/in-nextcloud-office-i-can-t-make-wopi-allowlist-work/152004
The text was updated successfully, but these errors were encountered: