Skip to content

v0.4.8

Latest

Choose a tag to compare

@oleksandr-nc oleksandr-nc released this 30 Oct 09:02
27764eb

HaRP 0.4.8 checks the HTTP method of every request to an ExApp against the verbs of its routes, as AppAPI's ExApp proxy does, and decides routes on the request path as the ExApp reads it. The default setup needs no configuration change.

Upgrading

  • When the verb check starts: AppAPI sends the route verbs from Nextcloud 35.0.3, 34.0.6, 33.0.11 and 32.0.16 on. Restart HaRP after updating Nextcloud, or disable and enable the ExApp, so that HaRP loads them. Until then HaRP matches routes by URL only, as before.
  • ExApps: a method that no route of the path lists gets 405 with an Allow header; HEAD is allowed wherever GET is. If the path read another way, for example in another letter case or without a trailing slash, matches a route with a higher access level, that level applies: /img/ needs a login when ^/img/.* is PUBLIC and .* is USER, and ^/img(/.*)?$ covers both. If an ExApp answers 405 or 403 after the upgrade, please report it to its author.
  • Custom /haproxy.cfg: copy the new http-request return status 405 line of haproxy.cfg.template into both frontends, otherwise these requests get 404.
  • Custom spoe-agent.conf: add method=method to the arguments of exapps_msg, otherwise HaRP matches routes by URL only. Remove it before going back to an older HaRP, which answers 503 while it is there.

Changes

  • The first route whose URL and verb match decides the access level and bruteforce protection. A method no route of the path lists gets 405 with Allow, without an IP ban strike or a user lookup. Routes without a verb are matched by URL only (#149).
  • Routes are matched against the path decoded once and with // merged; other readings of the path can only raise the access level (#152).
  • The forwarded path has escaped letters, digits and -._~ decoded, // merged, a raw \ as %5C and a % that starts no escape as %25; a path longer than 14 KiB once forwarded is refused. Requests from AppAPI keep their path (#152).
  • . and .. segments are refused in every spelling. Control characters and the /heartbeat, /init and /enabled endpoints in any spelling are refused unless AppAPI sends the request (#152).
  • README: route verbs and route paths for ExApp developers, HEAD on GET routes in AppAPI's ExApp proxy, and a shorter README that links to the Nextcloud manuals (#149, #150, #152, #153, #155).