CVE-2016-5725: Improper Limitation of a Pathname to a Restricted Directory in JCraft JSch
Summary
CVE-2016-5725: Improper Limitation of a Pathname to a Restricted Directory in JCraft JSch. Affects com.jcraft:jsch versions < 0.1.54. Fixed in 0.1.54. How to fix ↓
Also tracked for
- jsch · Debian:11
The same CVE-2016-5725 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
JCraft JSch is a Java implementation of the SSH2 protocol. It provides a simple interface for connecting to SSH servers and performing secure file transfers. JSch is widely used in various applications and libraries for SSH communication. However, versions before 0.1.54 on Windows are vulnerable to a directory traversal attack when the mode is set to ChannelSftp.OVERWRITE. This vulnerability allows remote SFTP servers to write to arbitrary files by exploiting a '..' (dot dot backslash) sequence in the response to a recursive GET command.
Vulnerability Detail
The vulnerability arises from a lack of proper limitation on the pathname during file transfers. By including the '..' sequence in the response, an attacker can navigate to parent directories and overwrite files outside the intended directory. This can lead to unauthorized modification or disclosure of sensitive information. The severity of this vulnerability is rated as MODERATE with a CVSS score of 5.9.
How To Fix
Minimum fixed version
0.1.54
This is the first release that contains the fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If updating the library is not immediately feasible, a temporary workaround can be implemented by disabling the ChannelSftp.OVERWRITE mode. By avoiding the use of this mode, the vulnerability can be mitigated. However, this workaround may impact the functionality of certain file transfer operations, so it is advised to update to the latest version of the library as soon as possible.
Conclusion
In conclusion, the JCraft JSch library versions before 0.1.54 on Windows are vulnerable to a directory traversal attack. This can be mitigated by updating the library to the latest version or temporarily disabling the ChannelSftp.OVERWRITE mode. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for com.jcraft:jsch →
FAQ
JCraft JSch is a Java implementation of the SSH2 protocol, providing a secure way to communicate with SSH servers and perform file transfers.
The vulnerability allows remote SFTP servers to write to arbitrary files, potentially leading to unauthorized modification or disclosure of sensitive information.
To fix this vulnerability, update the JCraft JSch library to version 0.1.54 or later.
A temporary workaround is to disable the ChannelSftp.OVERWRITE mode, but it is recommended to update the library instead.
The severity of this vulnerability is rated as MODERATE with a CVSS score of 5.9.
Follow Vulert in Google
Get more Vulert vulnerability and dependency-security updates in Google Search and AI results.