Javascript Cbc Cipher Unauthenticated Encryption
Description
Detects the use of CBC (Cipher Block Chaining) mode encryption in SSH2 SFTP client configurations. CBC mode is vulnerable to padding oracle attacks and lacks authentication, which could allow attackers to perform man-in-the-middle attacks and potentially decrypt sensitive information.
Weakness:
094 - Insecure encryption algorithm - Cipher Block Chaining
Category: Information Collection
Detection Strategy
• Check if the source code imports or requires the 'ssh2-sftp-client' module
• Search for SFTP client configuration settings or connection options
• Identify if CBC cipher modes are specified in the configuration or connection options
• Report a vulnerability if CBC cipher modes are explicitly configured or used as default
Vulnerable code example
const SftpClient = require('ssh2-sftp-client');
async function connectWithInsecureCipher() {
const client = new SftpClient();
const config = {
host: 'sftp.example.com',
username: 'user',...✅ Secure code example
const SftpClient = require('ssh2-sftp-client');
async function connectWithSecureCipher() {
const client = new SftpClient();
const config = {
host: 'sftp.example.com',
username: 'user',...Search for vulnerabilities in your apps for free with Fluid Attacks' automated security testing! Start your 21-day free trial and discover the benefits of the Continuous Hacking Essential plan. If you prefer the Advanced plan, which includes the expertise of Fluid Attacks' hacking team, fill out this contact form.