Skip to content

Commit

Permalink
Fix incorrect relative path checks to avoid bypassing path validation
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Sep 23, 2024
1 parent 64e45a7 commit 3ed1b8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/static_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ bool StaticHandler::hit() {
l_filename = http_server::url_decode(filename, p - filename);
filename[l_filename] = '\0';

if (swoole_strnpos(url, n, SW_STRL("..")) == -1) {
if (swoole_strnpos(filename, n, SW_STRL("..")) == -1) {
goto _detect_mime_type;
}

Expand Down

0 comments on commit 3ed1b8b

Please sign in to comment.