Skip to content

Insecure Protocol in Socket Connection

Description

The code uses insecure protocols (FTP, HTTP, Telnet) for socket connections, which transmit data in plaintext and can expose sensitive information.

Examples

Insecure Code

java
java.net.Socket socket = new java.net.Socket("ftp://example.com", 21);

Secure Code

java
java.net.Socket socket = new java.net.Socket("ftps://example.com", 21);

Remediation

Use encrypted alternatives such as HTTPS, FTPS/SFTP, or SSH to protect sensitive data in transit.

Rule Details

FieldValue
IDCODE-0240
CategoryCrypto
SeverityMEDIUM
CWECWE-319
ConfidenceLOW
ImpactMEDIUM
LikelihoodMEDIUM
ExploitabilityEASY
Tagssocket, insecure protocol
OWASPA3:2017-Sensitive Data Exposure, A02:2021-Cryptographic Failures

References