Mitigating Information Leakage in Large Language Models: Evaluating the Impact of Code Obfuscation on Vulnerability Detection

Large Language Models (LLMs) have become widely used in software development, offering assistance in developing, debugging, and optimizing code. However, their ability to analyze code also raises security concerns, particularly regarding information leakage and vulnerability detection. When used for vulnerability analysis, LLMs may inadvertently expose sensitive security weaknesses, effectively leaking information that could be exploited by attackers. This study investigates how effectively LLMs detect security vulnerabilities in source code and assesses the impact of various obfuscation techniques on reducing this risk. We constructed a data set of 400 C and Python code snippets, each containing security vulnerabilities classified into 51 Common Weakness Enumeration (CWE) categories. These snippets were analyzed using the ChatGPT-4o mini API to measure vulnerability detection accuracy before and after applying obfuscation techniques, including comment removal, string manipulation, identifier renaming, control flow and data flow obfuscation, dead code insertion, full encoding, and LLM-generated obfuscation. Our results demonstrate that while LLMs can effectively reason about the code, obfuscation significantly reduces their detection capabilities of potential vulnerabilities in the code, which we aim to prevent from leaking. Among the techniques tested, dead code insertion and control flow obfuscation were the most effective in decreasing detection accuracy, whereas simpler methods such as comment and identifier obfuscation had minimal impact. Additionally, encoding-based obfuscation, though highly disruptive, proved impractical due to severe functionality loss. These findings emphasize the need to balance obfuscation for security with maintaining code usability. By evaluating the effectiveness of different obfuscation techniques, this research provides practical guidance for developers seeking to minimize information leakage while leveraging LLMs in software development.

Authors

Institutions

Publication Details

Published
2025-06-30
DOI
https://doi.org/10.1109/eurospw67616.2025.00007
Primary Topic
Web Application Security Vulnerabilities
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Mitigating Information Leakage in Large Language Models: Evaluating the Impact of Code Obfuscation on Vulnerability Detection

Cemal Yılmaz, Bengü Gülay
Web Application Security Vulnerabilities
article

Mitigating Information Leakage in Large Language Models: Evaluating the Impact of Code Obfuscation on Vulnerability Detection

Cemal Yılmaz, Bengü Gülay
article en

Abstract

Large Language Models (LLMs) have become widely used in software development, offering assistance in developing, debugging, and optimizing code. However, their ability to analyze code also raises security concerns, particularly regarding information leakage and vulnerability detection. When used for vulnerability analysis, LLMs may inadvertently expose sensitive security weaknesses, effectively leaking information that could be exploited by attackers. This study investigates how effectively LLMs detect security vulnerabilities in source code and assesses the impact of various obfuscation techniques on reducing this risk. We constructed a data set of 400 C and Python code snippets, each containing security vulnerabilities classified into 51 Common Weakness Enumeration (CWE) categories. These snippets were analyzed using the ChatGPT-4o mini API to measure vulnerability detection accuracy before and after applying obfuscation techniques, including comment removal, string manipulation, identifier renaming, control flow and data flow obfuscation, dead code insertion, full encoding, and LLM-generated obfuscation. Our results demonstrate that while LLMs can effectively reason about the code, obfuscation significantly reduces their detection capabilities of potential vulnerabilities in the code, which we aim to prevent from leaking. Among the techniques tested, dead code insertion and control flow obfuscation were the most effective in decreasing detection accuracy, whereas simpler methods such as comment and identifier obfuscation had minimal impact. Additionally, encoding-based obfuscation, though highly disruptive, proved impractical due to severe functionality loss. These findings emphasize the need to balance obfuscation for security with maintaining code usability. By evaluating the effectiveness of different obfuscation techniques, this research provides practical guidance for developers seeking to minimize information leakage while leveraging LLMs in software development.

Sabancı Üniversitesi (TR)
Openalex Percentile: Top 66%
Web Application Security Vulnerabilities
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Mitigating Information Leakage in Large Language Models: Evaluating the Impact of Code Obfuscation on Vulnerability Detection — Cemal Yılmaz, Bengü Gülay · (2025) | TGRS Research Map | TGRS