Skip to content

RDF base URL ignores overwriteprotocol behind a TLS-terminating proxy, so served Turtle uses http:// IRIs #225

Open

Description

@hcientist

On an instance behind a reverse proxy that terminates TLS (Nextcloud AIO with
overwriteprotocol=https, overwritehost and trusted_proxies set), resources
served as text/turtle have their relative IRIs resolved against http://.

Example: the root ACL at https://<host>/apps/solid/~alice/storage/.acl, when
requested with Accept: text/turtle, comes back as

<http://<host>/apps/solid/~alice/storage/.acl#owner>
  ns0:accessTo <http://<host>/apps/solid/~alice/storage/> ;
  ns0:default  <http://<host>/apps/solid/~alice/storage/> ;

Impact: clients that inherit ACL rules break. Inrupt's universalAccess.setAgentAccess
(solid-client 2.1.2) creates a resource ACL from the fallback ACL by copying rules whose
acl:default equals the container URL. That's https://…/storage/ while the served
rules say http://…/storage/, so nothing gets copied. The new ACL has only
the newly granted agent, and the owner loses access to the resource (403 on
everything until the .acl file is removed through WebDAV).

Cause: StorageController, ProfileController, ContactsController and
CalendarController build $serverUri from $_SERVER['REQUEST_SCHEME'] and
SERVER_NAME. Behind the proxy those are http and the internal name, whatever
Nextcloud's overwrite settings say.

Fix: use $this->request->getServerProtocol() and getServerHost(), which
honour overwriteprotocol / overwritehost. Patch: hcientist@06c7767.

Related: #121 (closed unmerged) went the other way and also used the request scheme.
#48 (owner always keeps Control) would have prevented the lockout.

Seen on: Nextcloud 29.0.4 (AIO), solid app 0.10.0. The same code is on main.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions