5
0
mirror of git://git.proxmox.com/git/pve-http-server.git synced 2025-08-05 00:21:57 +03:00

10 Commits

Author SHA1 Message Date
75ad1cacb7 requests: assert that theres no @ in the URLs authority
We don't expect any userinfo in the authority and t o avoid that this
allows some leverage in doing weird things later its better to error
out early on such requests.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Originally-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-02 09:22:07 +02:00
3967071623 pass through streaming: only allow from privileged local pvedaemon
Ensures that no external request can control streaming on proxying
requests as safety net for when we'd have another issue in the
request handling part.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Originally-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-02 09:22:00 +02:00
42bb4f3725 proxy request: assert that API url starts with a slash
We implicitly assume that to be the case when assembling the target
URL, so assert it explicitly as it's user controlled input.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Originally-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-02 09:22:00 +02:00
f325788131 response: avoid linefeeds in response status
basically only possible to trigger with chromium based browsers
(chrome, edge, opera) but besides those having the biggest usage
currently its not that nice in any way.

Users could inject headers in their response, which isn't really that
bad itself, as they won't really do anything at least for sane
browsers that don't allow setting third party cookies by default
(unlike again, chrome), in which case one can create huge cookies
that then trigger the max header size check on requests, DOS'ing an
user's access to a PVE interface if they can get them to visit a
malicious site (a clear cooki actione would allow visiting it again)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reported-by: STAR Labs <info@starlabs.sg>
2022-07-02 09:22:00 +02:00
be2215c4c2 response: improve no content comment
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-07-02 09:22:00 +02:00
00661f1223 html formatter: encode href attributes
these contain untrusted data, so treat them accordingly.

Reported-by: Li, Jian Tao <li.jiantao@starlabs.sg>
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
(cherry picked from commit 6781735008)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-17 16:42:07 +02:00
d7e0d2c6bf websocket: add note about compat removal
this major release still needs to have an incompatible client, the next
one can drop setting a protocol client-side, and the one after that can
remove the protocol handling on the server side.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-05-18 10:18:32 +02:00
13a73eee2a AnyEvent/websocket_proxy: drop handling of websocket subprotocols
We do not support any, and we only ever send binary frames, so drop
trying to parse the header.

For compatibility with current clients (novnc, pve-xtermjs), we have
to reply with the protocols it sent.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-05-18 10:18:32 +02:00
015964a341 AnyEvent/websocket_proxy: remove 'base64' handling
novnc does not support this anymore since 2015, and neither does
our xtermjs client. it is also not listed in IANAs list of websocket
protocols [0].

so simply drop it and only send out binary frames and don't decode text frames

0: https://www.iana.org/assignments/websocket/websocket.xml#subprotocol-name

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-05-18 10:18:32 +02:00
f8f97c8d26 buildsys: split packaging and source build-systems
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-14 16:37:17 +02:00