Recently, a new vulnerability with CVE number CVE-2022-43928 was discovered, affecting the IBM Toolbox for Java, specifically Db2 Mirror for i 7.4 and 7.5. This vulnerability allows a user to obtain sensitive information stored in memory due to the usage of Java strings for processing. In this post, we will delve deep into the details of this vulnerability, its root cause, and how IBM has addressed the issue.

What is IBM Toolbox for Java?
IBM Toolbox for Java is a set of Java classes which can be used to access IBM i systems, providing Java applications with access to iSeries and AS/400 data and resources. Db2 Mirror for i is a feature within the toolbox that ensures continuous high availability and data integrity by providing a synchronous replica of the production database.

The Vulnerability - CVE-2022-43928

The root cause of CVE-2022-43928 lies in the fact that Java strings are immutable. This means that once the strings are created, their contents cannot be changed, and they exist in memory until garbage collected by the Java Virtual Machine (JVM). Consequently, sensitive data, such as authentication credentials or sensitive database queries, could be visible in memory over a virtually indefinite amount of time, making it susceptible to unauthorized access.

IBM X-Force ID: 241675 is used to reference this specific vulnerability in the IBM X-Force security database.

Exploit Details

To exploit this vulnerability, an attacker would need to gain access to the memory space where the sensitive information is stored. This would typically require unauthorized access to the JVM running the IBM Toolbox for Java application. Gaining access to memory can be achieved through various methods, such as buffer overflows or memory corruption vulnerabilities, which can be used in conjunction with this vulnerability to fully compromise the system.

Proof of Concept

In the following hypothetical code snippet, sensitive data is stored within a Java string and processed:

String sensitiveData = "AuthenticationToken:123456789";
// ... some code that uses sensitiveData ...


As mentioned earlier, the data in sensitiveData will remain in memory until garbage collected by the JVM, exposing it to potential unauthorized access.

IBM's Resolution

Rather than allowing sensitive information to reside in memory indefinitely, IBM has addressed this issue by reducing the amount of time the sensitive data remains visible in memory. This was achieved by creating a more efficient mechanism to process sensitive data without using immutable strings. Consequently, the risk of exposure is minimized, providing safer handling of critical data in IBM Toolbox for Java.

1. CVE-2022-43928: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-43928
2. IBM Security Bulletin: https://www.ibm.com/support/pages/node/6637393
3. IBM X-Force ID 241675: https://exchange.xforce.ibmcloud.com/vulnerabilities/241675

Conclusion

CVE-2022-43928 poses a significant threat to the security of IBM Toolbox for Java, especially Db2 Mirror for i 7.4 and 7.5. The vulnerability exposes sensitive information in memory due to the immutable nature of Java strings until they are garbage collected. IBM has addressed this issue by improving the way sensitive data is processed and reducing the exposure time in memory. Developers using IBM Toolbox for Java should ensure that they are using the latest patches provided by IBM to mitigate this vulnerability.

Timeline

Published on: 04/07/2023 14:15:00 UTC
Last modified on: 04/13/2023 20:49:00 UTC