Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Wiki Markup
It is also important to use SSL for secure Remote Method Invocation (RMI) communications because RMI depends on object serialization and serialized data must be safeguarded in transit. Gong et al. \[[Gong 2003|AA. Bibliography#Gong 03]\] describe how to secure RMI communications using {{SSLSockets}}.

Noncompliant Code Example

This example shows the use of regular sockets for a server application that does not protect sensitive information in transit. The insecure code for the corresponding client application follows the server's code.

...

Note that the sockets are closed in accordance with ERR05-J. Do not let checked exceptions escape from a finally block. While merely printing close exceptions is frowned upon, the exceptions may be suppresed as per EX0 of ERR00-J. Do not suppress or ignore checked exceptions.

Compliant Solution

This compliant solution makes use of SSLSockets to protect packets using the SSL/TLS security protocols.

...

Note that a program that makes use of SSLSockets will block indefinitely if it tries to connect to a port that is not using SSL. Similarly, a program that does not use SSLSockets will block when trying to establish a connection through a port that uses SSL.

Exceptions

SEC15SER04-EX1EX0: Because of the mechanisms that SSLSockets provide to ensure the secure transfer of packets, significant performance overhead may result. If no sensitive information is being transmitted, or the channel is not prone to attacks, regular Sockets are sufficient.

Risk Assesment

Using plain sockets instead of SSLSockets means that the data's confidentiality and integrity is not guaranteed.

Guideline

Severity

Likelihood

Remediation Cost

Priority

Level

SEC15 SER04-J

medium

likely

high

P6

L2

Automated Detection

The general case of automated detection appears to be infeasible, as determining which specific data may be passed through the socket is not statically computable. An approach that introduces a custom API for passing sensitive data via secure sockets may be feasible. User tagging of sensitive data would be a necessary requirement for such an approach.

Related Vulnerabilities

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

Bibliography

Wiki Markup
\[[API 2006|AA. Bibliography#API 06]\] 
\[[Gong 2003|AA. Bibliography#Gong 03]\] 11.3.3 "Securing RMI Communications"
\[[MITRE 2009|AA. Bibliography#MITRE 09]\] [CWE ID 311|http://cwe.mitre.org/data/definitions/311.html] "Failure to Encrypt Sensitive Data"
\[[Ware 2008|AA. Bibliography#Ware 08]\]

...