Using clear-text protocols exposes data in transit to eavesdropping and man-in-the-middle attacks.
An attacker who can observe network traffic — for example through a compromised network device, a position on the same network segment, or a cloud
environment breach — can read, modify, or inject data sent over ftp, telnet, http, or unencrypted SMTP without
detection. This is true even on internal or isolated networks, where insider threats or lateral movement after an initial compromise can expose
unencrypted traffic. This rule raises an issue when a clear-text protocol scheme is used or when encryption is explicitly disabled for a network
connection.
An attacker who can intercept network traffic can read all data transmitted over clear-text connections, including credentials, session tokens, API keys, or personal data.
Because clear-text protocols provide no integrity protection, an attacker in a man-in-the-middle position can silently modify data in transit — redirecting users to malicious endpoints, injecting malicious content into responses, or altering commands sent to remote services.
The following code uses a clear-text protocol or disables encryption for a network connection, leaving transmitted data exposed to interception.
url = "http://example.com"; // Noncompliant url = "ftp://anonymous@example.com"; // Noncompliant url = "telnet://anonymous@example.com"; // Noncompliant
For nodemailer:
const nodemailer = require("nodemailer");
let transporter = nodemailer.createTransport({
secure: false, // Noncompliant
requireTLS: false // Noncompliant
});
url = "https://example.com"; url = "sftp://anonymous@example.com"; url = "ssh://anonymous@example.com";
For nodemailer one of the following options must be set:
const nodemailer = require("nodemailer");
let transporter = nodemailer.createTransport({
secure: true,
requireTLS: true
});
The following code uses a clear-text protocol or disables encryption for a network connection, leaving transmitted data exposed to interception.
For aws-cdk-lib.aws-elasticloadbalancingv2.ApplicationLoadBalancer:
import { ApplicationLoadBalancer } from 'aws-cdk-lib/aws-elasticloadbalancingv2';
const alb = new ApplicationLoadBalancer(this, 'ALB', {
vpc: vpc,
internetFacing: true
});
alb.addListener('listener-http-default', {
port: 8080,
open: true
}); // Noncompliant
alb.addListener('listener-http-explicit', {
protocol: ApplicationProtocol.HTTP, // Noncompliant
port: 8080,
open: true
});
For aws-cdk-lib.aws-elasticloadbalancingv2.ApplicationLoadBalancer:
import { ApplicationLoadBalancer } from 'aws-cdk-lib/aws-elasticloadbalancingv2';
const alb = new ApplicationLoadBalancer(this, 'ALB', {
vpc: vpc,
internetFacing: true
});
alb.addListener('listener-https-explicit', {
protocol: ApplicationProtocol.HTTPS,
port: 8080,
open: true,
certificates: [certificate]
});
alb.addListener('listener-https-implicit', {
port: 8080,
open: true,
certificates: [certificate]
});
The following code uses a clear-text protocol or disables encryption for a network connection, leaving transmitted data exposed to interception.
For aws-cdk-lib.aws-elasticache.CfnReplicationGroup:
import { CfnReplicationGroup } from 'aws-cdk-lib/aws-elasticache';
new CfnReplicationGroup(this, 'example-implicit', {
replicationGroupDescription: 'exampleDescription'
}); // Noncompliant
new CfnReplicationGroup(this, 'example-explicit', {
replicationGroupDescription: 'exampleDescription',
transitEncryptionEnabled: false // Noncompliant
});
import { CfnReplicationGroup } from 'aws-cdk-lib/aws-elasticache';
new CfnReplicationGroup(this, 'example-explicit', {
replicationGroupDescription: 'example',
transitEncryptionEnabled: true
});
The following code uses a clear-text protocol or disables encryption for a network connection, leaving transmitted data exposed to interception.
For aws-cdk-lib.aws-kinesis.CfnStream:
import { CfnStream } from 'aws-cdk-lib/aws-kinesis';
new CfnStream(this, 'example-cfnstream-implicit', undefined); // Noncompliant
new CfnStream(this, 'example-cfnstream-explicit', {
streamEncryption: undefined // Noncompliant
});
For aws-cdk-lib.aws-kinesis.Stream:
import { Stream } from 'aws-cdk-lib/aws-kinesis';
new Stream(this, 'example-stream', {
encryption: StreamEncryption.UNENCRYPTED // Noncompliant
});
import { CfnStream } from 'aws-cdk-lib/aws-kinesis';
new CfnStream(this, 'example-cfnstream-explicit', {
streamEncryption: {
encryptionType: encryptionType,
keyId: encryptionKey.keyId,
}
});
import { Stream } from 'aws-cdk-lib/aws-kinesis';
new Stream(this, 'example-stream');
new Stream(this, 'example-stream-selfmanaged', {
encryption: StreamEncryption.KMS,
encryptionKey: encryptionKey,
});
new Stream(this, 'example-stream-managed', {
encryption: StreamEncryption.MANAGED
});
No issue is reported for the following cases:
www.w3.org,
schemas.android.com, schema.org).example.com, example.net, example.org (RFC 6761). These
are almost always placeholders in source code, not real connection targets.