Path Traversal in socket.io-file
High severity
GitHub Reviewed
Published
Jul 7, 2020
to the GitHub Advisory Database
•
Updated Jan 9, 2023
Description
Reviewed
Jul 7, 2020
Published to the GitHub Advisory Database
Jul 7, 2020
Last updated
Jan 9, 2023
All versions of
socket.io-file
are vulnerable to Path Traversal. The package fails to sanitize user input and uses it to generate the file upload paths. Thesocket.io-file::createFile
message contains aname
option that is passed directly topath.join()
. It is possible to upload files to arbitrary folders on the server by sending relative paths on thename
value, such as../../test.js
. TheuploadDir
andrename
options can be used to define the file upload path.References