Menu

#109 Privacy violation in jsch/Util.java

v1.0 (example)
open
nobody
None
5
2017-03-07
2017-03-07
No

The method byte2str() in Util.java stores sensitive data in a String object, making it impossible to reliably purge the data from memory.

Sensitive data (such as passwords, social security numbers, credit card numbers etc) stored in memory can be leaked if memory is not cleared after use. Often, Strings are used store sensitive data, however, since String objects are immutable, removing the value of a String from memory can only be done by the JVM garbage collector. The garbage collector is not required to run unless the JVM is low on memory, so there is no guarantee as to when garbage collection will take place. In the event of an application crash, a memory dump of the application might reveal sensitive data.

Recommendations:

Always be sure to clear sensitive data when it is no longer needed. Instead of storing sensitive data in immutable objects like Strings, use byte arrays or character arrays that can be programmatically cleared.

Discussion


Log in to post a comment.