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-fileare vulnerable to Path Traversal. The package fails to sanitize user input and uses it to generate the file upload paths. Thesocket.io-file::createFilemessage contains anameoption that is passed directly topath.join(). It is possible to upload files to arbitrary folders on the server by sending relative paths on thenamevalue, such as../../test.js. TheuploadDirandrenameoptions can be used to define the file upload path.References