Detection of Sensitive Data Exposures in JVM Applications with Bidirectional Text Correlation Analysis
Creators: name: Ganz, Leonard
Publisher: name: Zenodo
Year: 2024

description: Master's thesis submitted at Institute of Informatics of Ludwig-Maximilians-Universität München on November 4, 2024.

Supervisor: Prof. Dr. Marie-Christine Jakobs

Abstract:

In modern software development, ensuring the security of sensitive data is paramount. Poor logging practices can inadvertently expose sensitive information, posing significant security risks. Therefore, it is crucial to detect sensitive data exposures early in the development process. Traditional static analysis tools, however, often fall short in detecting such exposures, especially if data is exposed before its sensitivity can be determined. To address this issue, our thesis introduces JVM-BidText, a tool designed to detect sensitive data exposures in JVM applications using bidirectional text correlation analysis. With bidirectional analysis, JVM-BidText can handle scenarios where a tool can only infer the sensitivity of data after the data has already been exposed. Moreover, JVM-BidText infers the sensitivity of data automatically by analyzing static strings in the source code, reducing the need for manual input. JVM-BidText generalizes the capabilities of the existing tool BidText, originally developed for Android applications. Our main objective is to make the benefits of BidText available to a broader range of applications. First, we refactor and upgrade the codebase of BidText to support Java up to version 23. Second, we modify the setup of the analysis engine, remove Android-specific components, and adapt propagation rules and sink definitions. Furthermore, we generalize the text analysis and other components to support JVM applications. To find keywords suitable for inferring the sensitivity of data in JVM applications, we conduct a study on a real-world application. By supporting JVM bytecode, we extend the scope of supported applications even beyond Java and make JVM-BidText capable of analyzing applications written in other JVM languages like Kotlin. In general, JVM languages are very heterogeneous. We identify that libraries and frameworks pose additional challenges for JVM-BidText because essential parts of the program flow are hidden in external code. To aid the analysis of libraries and applications built on top of the popular Spring framework, we implement different strategies for the detection of entry points, including the identification of callback methods and controller endpoints. Furthermore, we enhance JVM-BidText to support dependency injection in the Spring framework. To this end, we model Inversion of Control on an intermediate representation level and perform bytecode modification, enabling JVM-BidText to analyze data flow through Spring managed classes. Thereby, we extend JVM-BidText's applicability to enterprise-grade applications. Our evaluation includes multiple case studies, comparing JVM-BidText to GitHub CodeQL, a state-of-the-art static analysis tool. The results demonstrate that JVM-BidText effectively detects sensitive data exposures with little manual input, outperforming CodeQL in specific scenarios. In comparison to CodeQL, a significant advantage of the approach we implement in JVM-BidText is the ability to analyze data flows that involve standard or third-party library methods. Furthermore, in contrast to CodeQL, our tool can detect sensitive data exposures that require bidirectional reasoning. This capability is especially useful for the detection of insecure whole-object logging ---the most common root cause for sensitive data exposure vulnerabilities (see here).