Towards Secure Logging: Characterizing and Benchmarking Logging Code Security Issues with LLMs
Not on the map. Why?
Abstract (arXiv)
Logging code plays an important role in software systems by recording key events and behaviors, which are essential for debugging and monitoring. However, insecure logging practices can inadvertently expose sensitive information or enable attacks such as log injection, posing serious threats to system security and privacy. Prior research has examined general defects in logging code, but systematic analysis of logging code security issues remains limited, particularly in leveraging LLMs for detection and repair. In this paper, we derive a comprehensive taxonomy of logging code security issues, encompassing four common issue categories and 10 corresponding patterns. We further construct a benchmark dataset with 101 real-world logging security issue reports that have been manually reviewed and annotated. We then propose an automated framework that incorporates various contextual knowledge to evaluate LLMs' capabilities in detecting and repairing logging security issues. Our experimental results reveal a notable disparity in performance: while LLMs are moderately effective at detecting security issues (e.g., the accuracy ranges from 12.9% to 52.5% on average), they face noticeable challenges in reliably generating correct code repairs. We also find that the issue description alone improves the LLMs' detection accuracy more than the security pattern explanation or a combination of both. Overall, our findings provide actionable insights for practitioners and highlight the potential and limitations of current LLMs for secure logging.
Key facts. Cited by 2 papers in the map (data through 13 Oct 2026). Builds on 26 of its 62 references that are in the map. First posted on arXiv 22 Apr 2026.
Builds on
26 of 62 references.
References · 26
- 2024The Llama 3 Herd of Modelscited by 14,486
- 2025Qwen3 Technical Reportcited by 8,510
- 2021Vulnerability Detection with Fine-grained Interpretationscited by 56
- 2023LILAC: Log Parsing using LLMs with Adaptive Parsing Cachecited by 30
- 2023A Large-Scale Evaluation for Log Parsing Techniques: How Far Are We?cited by 25
- 2024Multitask-based Evaluation of Open-Source LLM on Software Vulnerabilitycited by 23
- 2024ThinkRepair: Self-Directed Automated Program Repaircited by 23
- 2022What Makes a Good Commit Message?cited by 20
- 2023Did We Miss Something Important? Studying and Exploring Variable-Aware Log Abstractioncited by 19
- 2025COFFE: A Code Efficiency Benchmark for Code Generationcited by 19
- 2022Using Deep Learning to Generate Complete Log Statementscited by 17
- 2025Correctness Assessment of Code Generated by Large Language Models Using Internal Representationscited by 17
14 more
- 2025Assessing and Advancing Benchmarks for Evaluating Large Language Models in Software Engineering Taskscited by 17
- 2025SecureVibeBench: Benchmarking Secure Vibe Coding of AI Agents via Reconstructing Vulnerability-Introducing Scenarioscited by 12
- 2024Go Static: Contextualized Logging Statement Generationcited by 9
- 2025Code Change Intention, Development Artifact and History Vulnerability: Putting Them Together for Vulnerability Fix Detection by LLMcited by 6
- 2023Are They All Good? Studying Practitioners' Expectations on the Readability of Log Messagescited by 4
- 2024LogUpdater: Automated Detection and Repair of Specific Defects in Logging Statementscited by 4
- 2024Understanding Practitioners' Expectations on Clear Code Review Commentscited by 4
- 2025One-for-All Does Not Work! Enhancing Vulnerability Detection by Mixture-of-Experts (MoE)cited by 4
- 2025PEACE: Towards Efficient Project-Level Efficiency Optimization via Hybrid Code Editingcited by 4
- 2024Protecting Privacy in Software Logs: What Should Be Anonymized?cited by 3
- 2024Studying and Benchmarking Large Language Models For Log Level Suggestioncited by 2
- 2025SDLog: A Deep Learning Framework for Detecting Sensitive Information in Software Logscited by 2
- 2025Defects4Log: Benchmarking LLMs for Logging Code Defect Detection and Reasoningcited by 2
- 2025LLM4Perf: Large Language Models Are Effective Samplers for Multi-Objective Performance Modelingcited by 2
Built on by
Citing papers per year: 2026: 2.
2 papers.