]> git.proxmox.com Git - pve-http-server.git/commitdiff
explicitly disallow tmpfilename parameter in query URL
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 14 Apr 2023 14:09:07 +0000 (16:09 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 14 Apr 2023 14:22:40 +0000 (16:22 +0200)
This is an internal parameter and we pass the actual internal one
around via the $reqstate variable, so avoid confusion and return a
clear error if a POST request sets this query parameter.

Reported-by: Friedrich Weber <f.weber@proxmox.com>
Suggested-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/APIServer/AnyEvent.pm

index 2fa74d28ad7001e53c112809ae4ba3223027cae5..5cd8afbd1e6724bcc9c590d56f4cafc22a1f3efc 100644 (file)
@@ -1571,6 +1571,10 @@ sub authenticate_and_handle_request {
                starttime => [gettimeofday],
                outfh => $outfh,
            };
+
+           die "'tmpfilename' query parameter is not allowed for file uploads\n"
+               if exists $state->{params}->{tmpfilename};
+
            $reqstate->{tmpfilename} = $tmpfilename;
            $reqstate->{hdl}->on_read(sub {
                $self->file_upload_multipart($reqstate, $auth, $method, $path, $state);