Vulnerabilities |
5 via 5 paths |
|---|---|
Dependencies |
66 |
Source |
GitHub |
Find, fix and prevent vulnerabilities in your code.
high severity
- Vulnerable module: tar-fs
- Introduced through: dockerode@3.3.5
Detailed paths
-
Introduced through: mongodoki@vivocha/mongodoki › dockerode@3.3.5 › tar-fs@2.0.1Remediation: Upgrade to dockerode@4.0.5.
Overview
tar-fs is a filesystem bindings for tar-stream.
Affected versions of this package are vulnerable to Improper Link Resolution Before File Access ('Link Following') through the exports.extract function. An attacker can manipulate the path of extracted files to write outside the intended directory by crafting a malicious tarball.
Workaround
This vulnerability can be mitigated by using the ignore option to ignore paths like symlinks that are not files/directories.
ignore (_, header) {
// pass files & directories, ignore e.g. symlinks
return header.type !== 'file' && header.type !== 'directory'
}
Details
A Directory Traversal attack (also known as path traversal) aims to access files and directories that are stored outside the intended folder. By manipulating files with "dot-dot-slash (../)" sequences and its variations, or by using absolute file paths, it may be possible to access arbitrary files and directories stored on file system, including application source code, configuration, and other critical system files.
Directory Traversal vulnerabilities can be generally divided into two types:
- Information Disclosure: Allows the attacker to gain information about the folder structure or read the contents of sensitive files on the system.
st is a module for serving static files on web pages, and contains a vulnerability of this type. In our example, we will serve files from the public route.
If an attacker requests the following URL from our server, it will in turn leak the sensitive private key of the root user.
curl http://localhost:8080/public/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/root/.ssh/id_rsa
Note %2e is the URL encoded version of . (dot).
- Writing arbitrary files: Allows the attacker to create or replace existing files. This type of vulnerability is also known as
Zip-Slip.
One way to achieve this is by using a malicious zip archive that holds path traversal filenames. When each filename in the zip archive gets concatenated to the target extraction folder, without validation, the final path ends up outside of the target folder. If an executable or a configuration file is overwritten with a file containing malicious code, the problem can turn into an arbitrary code execution issue quite easily.
The following is an example of a zip archive with one benign file and one malicious file. Extracting the malicious file will result in traversing out of the target folder, ending up in /root/.ssh/ overwriting the authorized_keys file:
2018-04-15 22:04:29 ..... 19 19 good.txt
2018-04-15 22:04:42 ..... 20 20 ../../../../../../root/.ssh/authorized_keys
Remediation
Upgrade tar-fs to version 1.16.5, 2.1.3, 3.0.9 or higher.
References
high severity
- Vulnerable module: tar-fs
- Introduced through: dockerode@3.3.5
Detailed paths
-
Introduced through: mongodoki@vivocha/mongodoki › dockerode@3.3.5 › tar-fs@2.0.1Remediation: Upgrade to dockerode@4.0.5.
Overview
tar-fs is a filesystem bindings for tar-stream.
Affected versions of this package are vulnerable to Symlink Attack via the extraction process of a maliciously crafted tar file. An attacker can overwrite or write unauthorized files outside the intended directory by exploiting the path traversal and link following vulnerabilities.
Remediation
Upgrade tar-fs to version 1.16.4, 2.1.2, 3.0.7 or higher.
References
medium severity
new
- Vulnerable module: mongodb
- Introduced through: mongodb@4.17.2
Detailed paths
-
Introduced through: mongodoki@vivocha/mongodoki › mongodb@4.17.2Remediation: Upgrade to mongodb@7.9.1.
Overview
mongodb is an official MongoDB driver for Node.js.
Affected versions of this package are vulnerable to Improper Neutralization of Null Byte or NUL Character in the plain.js PLAIN authentication provider, which builds the SASL PLAIN message by joining the username and password with NUL separators without rejecting NUL characters inside either field. A user with valid credentials for one identity can authenticate as that identity instead of the one the application constructed, bypassing application-side identity checks such as an allow list or a required username suffix, by supplying a username containing NUL-separated authentication and password values. This affects only applications that use authMechanism: 'PLAIN' and build the username or password from less trusted input.
Workaround
This vulnerability can be avoided by rejecting any username or password that contains a NUL character (\0, or %00 in a connection string) before passing it to MongoClient.
Remediation
Upgrade mongodb to version 7.9.1 or higher.
References
medium severity
new
- Vulnerable module: mongodb
- Introduced through: mongodb@4.17.2
Detailed paths
-
Introduced through: mongodoki@vivocha/mongodoki › mongodb@4.17.2Remediation: Upgrade to mongodb@7.9.1.
Overview
mongodb is an official MongoDB driver for Node.js.
Affected versions of this package are vulnerable to Information Exposure in the HostAddress class in utils.ts and the parseOptions function in connection_string.ts, which include connection-string components in the messages and cause of errors thrown during MongoClient construction and connection. An attacker with access to the application's logs can obtain database credentials when the application passes a connection string with credentials but no valid host, because the user:pass portion is parsed as host:port and appears in the resulting Unable to parse ... with URL error and its cause.input. This affects only applications that build connection strings from user or configuration input where a missing or malformed host can reach the driver, and that log driver errors or MongoClient instances.
Workaround
This vulnerability can be avoided by validating that connection strings contain a host before passing them to the driver, and by redacting the message and cause of errors raised during MongoClient construction or connection before logging them.
Remediation
Upgrade mongodb to version 7.9.1 or higher.
References
medium severity
- Vulnerable module: tar-fs
- Introduced through: dockerode@3.3.5
Detailed paths
-
Introduced through: mongodoki@vivocha/mongodoki › dockerode@3.3.5 › tar-fs@2.0.1Remediation: Upgrade to dockerode@4.0.5.
Overview
tar-fs is a filesystem bindings for tar-stream.
Affected versions of this package are vulnerable to Symlink Following via the symlink validation process in the inCwd function. An attacker can write files outside the intended extraction directory by crafting a malicious tarball that contains symlinks starting with the name of the current working directory.
Workaround
This vulnerability can be mitigated by using the ignore option to exclude non-file and non-directory entries during the extraction process.
Remediation
Upgrade tar-fs to version 1.16.6, 2.1.4, 3.1.1 or higher.