GitHub Advisoryadvisory · npm

GHSA-9h4g-27m8-qjrg Path Traversal in socket.io-file

HIGH Published 2020-07-07 Modified 2021-09-22 Official page ↗
Aliases
CVE-2020-15779
Ecosystem
npm
Packages
socket.io-file
Severity
High
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Weaknesses
CWE-22
Reviewed
2020-07-07

Affected packages

• npm socket.io-file: <= 2.0.31 (no fix yet)

Description

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. The `socket.io-file::createFile` message contains a `name` option that is passed directly to `path.join()`. It is possible to upload files to arbitrary folders on the server by sending relative paths on the `name` value, such as `../../test.js`. The `uploadDir` and `rename` options can be used to define the file upload path.

Related

Alias · CVE (1)

  • CVE-2020-15779 A Path Traversal issue was discovered in the socket.io-file package through 2.0.31 for Node.js. vulnerability

Weakness · CWE (1)

  • CWE-22 Improper Limitation of a Pathname to a Restricted Directory weakness

References