proxmox-backup/src/server
Thomas Lamprecht 4703ba81ce server: rest: implement max URI path and query length request limits
Add a generous limit now and return the correct error (414 URI Too
Long). Otherwise we could to pretty larger GET requests, 64 KiB and
possible bigger (at 64 KiB my simple curl test failed due to
shell/curl limitations).

For now allow a 3072 characters as combined length of URI path and
query.

This is conform with the HTTP/1.1 RFCs (e.g., RFC 7231, 6.5.12 and
RFC 2616, 3.2.1) which do not specify any limits, upper or lower, but
require that all server accessible resources mus be reachable without
getting 414, which is normally fulfilled as we have various length
limits for stuff which could be in an URI, in place, e.g.:
 * user id: max. 64 chars
 * datastore: max. 32 chars

The only known problematic API endpoint is the catalog one, used in
the GUI's pxar file browser:
GET /api2/json/admin/datastore/<id>/catalog?..&filepath=<path>

The <path> is the encoded archive path, and can be arbitrary long.

But, this is a flawed design, as even without this new limit one can
easily generate archives which cannot be browsed anymore, as hyper
only accepts requests with max. 64 KiB in the URI.
So rather, we should move that to a GET-as-POST call, which has no
such limitations (and would not need to base32 encode the path).

Note: This change was inspired by adding a request access log, which
profits from such limits as we can then rely on certain atomicity
guarantees when writing requests to the log.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-16 10:40:39 +02:00
..
command_socket.rs src/server/command_socket.rs: do not abort loop on client errors, allow backup gid 2020-05-07 09:27:33 +02:00
config.rs server/config: add mechanism to update template 2020-07-23 11:55:00 +02:00
environment.rs server/rest: forward real client IP on proxied request 2020-10-16 10:36:54 +02:00
formatter.rs depend on proxmox 0.1.31 - use Value to store result metadata 2020-05-18 09:57:35 +02:00
h2service.rs bump proxmox to 0.3, cleanup http_err macro usage 2020-07-29 09:38:36 +02:00
rest.rs server: rest: implement max URI path and query length request limits 2020-10-16 10:40:39 +02:00
state.rs followup: server/state: rename task_count to internal_task_count 2020-07-24 12:11:39 +02:00
upid.rs avoid chrono dependency, depend on proxmox 0.3.8 2020-09-15 07:12:57 +02:00
worker_task.rs introduce TaskState trait 2020-10-12 14:11:57 +02:00