You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a backslash(\) exists at the end point of a uploaded file name, a parsed file name is include a double quote(").
I seem a problem exists in in Mojo::Message::parse_formdata method.
my ($filename) = $disposition =~ /[; ]filename\s*=\s*"?((?:\\"|[^"])*)"?/i;
For example, when the file name is foo\"bar\, and Content-Disposition header includes ; filename="foo\"bar\", that regular expression matches foo\"bar\".
A $name variable has a same problem too.
my ($name) = $disposition =~ /[; ]name\s*=\s*"?((?:\\"|[^";])+)"?/i;
My proposal is ...
my ($filename) = $disposition =~ /[; ]filename\s*=\s*"?((?:\\"(?!\s|\z)|[^"])*)"?/i;
and
my ($name) = $disposition =~ /[; ]name\s*=\s*"?((?:\\"(?!;|\s|\z)|[^";])+)"?/i;
Any good idea?
The text was updated successfully, but these errors were encountered:
If a backslash(
\
) exists at the end point of a uploaded file name, a parsed file name is include a double quote("
).I seem a problem exists in in
Mojo::Message::parse_formdata
method.For example, when the file name is
foo\"bar\
, andContent-Disposition
header includes; filename="foo\"bar\"
, that regular expression matchesfoo\"bar\"
.A
$name
variable has a same problem too.My proposal is ...
and
Any good idea?
The text was updated successfully, but these errors were encountered: