The detail::is_valid_path function judges std::strings that contain embedded NUL bytes ('\0') as valid paths. At least on Linux, this is not the case: paths are NUL-terminated and cannot contain NULs. The interpretation difference means that the file request handler can be tricked into serving static files with an unexpected Content-Type:
The
detail::is_valid_path
function judgesstd::string
s that contain embedded NUL bytes ('\0'
) as valid paths. At least on Linux, this is not the case: paths are NUL-terminated and cannot contain NULs. The interpretation difference means that the file request handler can be tricked into serving static files with an unexpected Content-Type:Tested on Linux with httplib 0.13.1.