Detecting Vulnerabilities in Encrypted Software Code while Ensuring Code Privacy
Jorge Martins, David Dantas, Rafael Ramires, Bernardo Ferreira, Ibéria Medeiros · 2025
Read Detecting Vulnerabilities in Encrypted Software Code while Ensuring Code Privacy by Jorge Martins, David Dantas, Rafael Ramires, Bernardo Ferreira, Ibéria Medeiros (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2501-09191.txt.
Introduction
Jorge Martins and co-authors present a tool that hunts software flaws in locked code in a 2025 paper. Firms often hire outside teams to scan code for weak spots. That scan needs open code, which risks leaks of trade secrets. Attackers with open code can run the same scans. The team ask whether flaws can be found while the code stays encrypted.
Their tool, CoCoA, pairs code checks with a search method that works on locked text. Code flow is stored as a locked index that still lets the tool trace data paths. On real PHP web apps the tool hit 93 percent precision, close to open-code tools. It scanned 4,000 lines in about a fifth of a second, with a modest time cost. The authors frame the work as the start of a new field: secret code checks.
Catalog record
| CREATOR | Jorge Martins, David Dantas, Rafael Ramires, Bernardo Ferreira, Ibéria Medeiros |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 90 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2501-09191
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Detecting Vulnerabilities in Encrypted Software Code while Ensuring Code Privacy Jorge Martins, David Dantas, Rafael Ramires, Bernardo Ferreira, Ibéria Medeiros Abstract Software vulnerabilities continue to be the primary cause of cyberattacks, largely due to the widespread adoption of web applications, developed for access and management services, that are made available without proper testing. It is crucial to identify vulnerabilities in applications’ source code before attackers gain access to them and exploit any vulnerability they may contain. Developers have used static analysis tools to find vulnerabilities in unprotected application code, and software testing companies have started offering software code analysis as a service to assist developers in these findings. Such services require access to unprotected code, which raises concerns about its privacy and intellectual property theft. Moreover, attackers can also perform this analysis using similar tools, if they gain access to the code. It is, therefore, beneficial to have a system that can maintain code privacy by protecting it with cryptographic techniques, while still allowing authorised people to detect vulnerabilities in the encrypted code. This paper presents such a solution, a novel approach to Software Quality and Privacy that allows source code to be analysed in a protected manner, preserving its privacy. The proposed solution combines Static Analysis with Searchable Symmetric Encryption (SSE) for confidential vulnerability detection, enabling data and dependency tracking for data flow analysis over encrypted source code. The solution represents the code’s data and control flows as an Encrypted Inverted Index , in a connected way that enables SSE’s queries for vulnerability discovery. The solution was implemented as the CoCoA tool and evaluated experimentally with synthetic and real PHP web applications. Results show that CoCoA has similar precision as standard (non-confidential) static analysis tools – 93% – with real applications, requiring only 209 ms to process 4k lines of code - a modest overhead of 42.7% compared to a non-confidential baseline. With this novel approach, this paper also defines a new research field – Confidential Code Analysis –, from which other types of code analysis tasks and approaches can be derived. We believe this work paves the way for this promising area of research, from which Software Quality and Privacy can greatly benefit. I Introduction Software has played an essential role in our global technological world. Despite the efforts software companies have made to build quality software, the number of vulnerabilities continues to increase [ 62 ] , so much so that the number of cyber attacks has risen to the highest record in recent years [ 9 ] . This increase is justified by the accelerating digital transformation, and indicates that inadequately tested software has been made available to the public, thus causing a decline in overall quality [ 17 ] . Web applications are at the root of this transformation, serving as the primary means of accessing and managing services; hence, the vulnerabilities they contain are a source for this security problem. This makes these attractive targets for attackers [ 66 ] , with SQL injection (SQLi) and cross-site scripting (XSS) being among the most exploited vulnerabilities [ 64 ] . To contradict these figures, static analysis tools [ 36 , 45 , 48 ] have been used to analyse unprotected source code, identifying vulnerabilities and suggesting how to fix them. Developers and software testing companies have resorted to these tools to achieve software quality assurance [ 39 , 40 , 49 ] , with the latter also starting to offer them as a cloud-based service [ 61 , 58 , 67 ] . In this service, software can undergo a series of code analysis tasks, including vulnerability detection, to properly test the software and improve its quality and reliability [ 43 , 32 , 33 , 22 , 10 ] . However, this requires access to the unprotected source code, raising concerns about its privacy and theft of intellectual property [ 50 ] . Moreover, attackers can also perform this analysis using similar tools if they gain access to the code. Code obfuscation [ 60 , 70 , 4 , 31 , 37 ] and code encryption [ 11 , 6 , 19 ] techniques have the goal of making the code unreadable. They are thereby seen as a way for software companies to protect their code against potential copyright violations, reverse engineering, and code privacy preservation, thus preventing (malicious) third parties from inspecting it. When applied, they can transform (i.e., obfuscate/encrypt) the entire code or specific portions (e.g., entry points, sensitive sinks), making it totally or partially illegible for reading. As such, the level of protection offered by these techniques relies on the strength of the algorithms and cryptographic keys used. We have observed that such algorithms have been broken [ 31 , 6 ] and cryptographic keys have been discovered [ 11 ] , compromising code protection. Moreover, when the code needs to be analysed (even by developers), it is unprotected (de-obfuscated or decrypted) during the analysis process, which can compromise its secrecy. Hence, although such techniques provide a sense of protection, they do not offer real guarantees of code privacy, and are impractical for third parties to conduct code analysis tasks. An interesting solution to overcome these concerns would be, therefore, to have a system that guarantees the confidentiality of the code by protecting it with cryptographic techniques, while at the same time allowing authorised people to perform code analysis tasks on the encrypted code, such as detecting vulnerabilities. This paper presents such a solution, a novel approach that protects software code by using an encryption scheme that enables vulnerability finding on the encrypted code without revealing its contents during the analysis. The approach combines Static Code Analysis (SCA) [ 48 ] with Searchable Symmetric Encryption (SSE) [ 65 ] , two disjoint research fields that would seem unlikely to be combined. In SCA, the application’s code is represented by code property graphs (e.g., control flow graph and data flow graph) [ 24 , 72 , 3 ] which can then be used for different purposes, such as vulnerability detection [ 16 ] . Static analysis tools navigate them, looking for what they were programmed for. They may employ various SCA techniques, with taint analysis [ 36 ] being the most commonly applied, which allows tracking entry points (user inputs like $_POST in PHP) and checking if they reach sensitive sinks (e.g., echo for XSS). However, these tools require access to the application’s unprotected code, without it being obfuscated nor encrypted. In turn, in SSE [ 15 ] , text documents are represented through an inverted index [ 42 ] , where keywords (i.e., the documents’ most relevant words) are mapped to the documents where they appear. This index is encrypted in a manner that it leaks no information when stored in remote (untrusted) servers, but nonetheless, authorised clients can query it to find index positions (i.e., the documents) containing the keywords they search for. We propose combining these two research fields to enable static analysis capable of operating on and understanding encrypted code , and implement the approach as a new tool named CoCoA ( Co nfidential dete C ti o n of vulner A bilities ). CoCoA processes the source