HYDRA: A Hybrid Heuristic-Guided Deep Representation Architecture for Predicting Latent Zero-Day Vulnerabilities in Patched Functions

Mohammad Farhad, Sabbir Rahman, Shuvalaxmi Dass · 2025

Read HYDRA: A Hybrid Heuristic-Guided Deep Representation Architecture for Predicting Latent Zero-Day Vulnerabilities in Patched Functions by Mohammad Farhad, Sabbir Rahman, Shuvalaxmi Dass (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-2511-06220.txt.

Introduction

Mohammad Farhad, Sabbir Rahman, and Shuvalaxmi Dass hunt for flaws that survive software patches. A patch can leave latent weaknesses behind when a fix is incomplete or an issue was overlooked, and those leftovers may later become zero-day exploits. Their system, HYDRA, predicts which patched functions still carry hidden risk.

HYDRA mixes rule-based security heuristics with deep learning over code. It combines static vulnerability rules, GraphCodeBERT embeddings, and a variational autoencoder to flag odd code patterns. Tested without supervision on patched functions from Chrome, Android, and ImageMagick, it flagged roughly fourteen to twenty-four percent of functions as risky, beating baselines built on pattern features alone.

Catalog record

CREATORMohammad Farhad, Sabbir Rahman, Shuvalaxmi Dass
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE56 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2511-06220

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

HYDRA: A Hybrid Heuristic-Guided Deep Representation Architecture for Predicting Latent Zero-Day Vulnerabilities in Patched Functions Mohammad Farhad, Sabbir Rahman, Shuvalaxmi Dass Abstract . Software security testing, particularly when enhanced with deep learning models, has become a powerful approach for improving software quality, enabling faster detection of known flaws in source code. However, many approaches miss post-fix latent vulnerabilities that remain even after patches typically due to incomplete fixes or overlooked issues may later lead to zero-day exploits. In this paper, we propose HYDRA , a Hy brid heuristic-guided D eep R epresentation A rchitecture for predicting latent zero-day vulnerabilities in patched functions that combines rule-based heuristics with deep representation learning to detect latent risky code patterns that may persist after patches. It integrates static vulnerability rules, GraphCodeBERT embeddings, and a Variational Autoencoder (VAE) to uncover anomalies often missed by symbolic or neural models alone. We evaluate HYDRA in an unsupervised setting on patched functions from three diverse real-world software projects: Chrome, Android, and ImageMagick. Our results show HYDRA predicts 13.7%, 20.6%, and 24% of functions from Chrome, Android, and ImageMagick respectively as containing latent risks, including both heuristic matches and cases without heuristic matches ( None ) that may lead to zero-day vulnerabilities. It outperforms baseline models that rely solely on regex-derived features or their combination with embeddings, uncovering truly risky code variants that largely align with known heuristic patterns. These results demonstrate HYDRA’s capability to surface hidden, previously undetected risks, advancing software security validation and supporting proactive zero-day vulnerabilities discovery. 1. INTRODUCTION Software vulnerabilities have emerged as a constant and dynamic threat as a result of the complexity and inter-connectivity of modern software system ( Makrakis et al. 2021 ; Zio 2016 ) . In response, software security testing has long been a cornerstone of software quality assurance, providing systematic and repeatable methods to verify software correctness, robustness, and reliability. As software systems continue to evolve rapidly, security testing has become essential for ensuring resilience and reliability throughout the software development lifecycle ( Kamal et al. 2020 ; Tuteja et al. 2012 ; Sneha and Malle 2017 ) . Despite these advancements in security testing and validation, zero-day vulnerabilities continue to pose a biggest risks to software security that are unpatched at the time of discovery and unknown to vendor. More formally, Zero-day vulnerabilities refer to previously unknown security flaws in software that are exploited before developers have had an opportunity to identify, patch, or disclose them ( Bilge and Dumitraş 2012 ) . These vulnerabilities often arise due to overlooked edge cases, incomplete patches, or misunderstandings of complex system behavior. As no official fix exists at the time of exploitation, zero-day attacks pose significant risks particularly in critical infrastructure, IoT, and open-source ecosystems. High profile incidents such as Stuxnet in 2010 ( stu [n. d.] ) and SolarWinds Orion in 2020 ( sol [n. d.] ) underscore the destructive potential of zero-day exploits and the importance of proactive vulnerability auditing. They enable hackers to take advantage of vulnerabilities before remedy is available, giving rise to silent, targeted attacks with devastating effects on users and systems ( Roumani 2021 ; Zakharov and Gladkikh 2024 ) . Open-source companies sometimes decide to patch vulnerabilities covertly without revealing them through formal advisories like CVE ( cve ) reports because of worries about maintainability and reputation. By converting zero-day risks into so called n-day vulnerabilities, this silent patching technique allows adversaries to target unpatched installations and reverse-engineer patches before downstream consumers can apply updates ( Wang et al. 2019 ) . However most traditional methods like static analysis tools (e.g., Fortify) and signature based scanners (e.g. CodeQL) are built to identify known patterns of insecure code, despite the fact that researchers have made impressive strides in creating deep learning based vulnerability detectors. Using a variety of techniques, researchers have tried to find these hidden defects. For instance anomaly detection and autoencoder based techniques have been investigated to capture latent behavioral patterns of zero-day threats in network traffic ( Nandakumar et al. [n. d.] ) , while machine learning classifiers have been trained to differentiate between benign code changes and secret security patches ( Wang et al. 2019 ) . To describe patch timescales and programming language risks, others have been conducted empirical analysis of open source software repositories ( Zakharov and Gladkikh 2024 ) . However, the majority of these methods either use post-disclosure datasets or target network traffic or binary code, losing the proactive chance to reason about already fixed functions. In order to identify potential residual vulnerabilities, recent studies have emphasized the importance and practicality of mining silent patches (i.e., fixes that are applied without public disclosure) and tracing them back to their root causes or original vulnerable code. For instance, GraphSPD ( Wang et al. 2023 ) and GRAPE ( Han et al. 2024 ) use code property graphs and Graph Convulational Networks to detect undocumented vulnerability patches by analyzing structural differences. While effective, they frequently make the assumption that both pre-patch and post-patch code are available. DeepDFA ( Steenhoek et al. 2024 ) extends vulnerability semantics using control/data-flow graphs and deep learning, achieving strong generalization and fast training, but still demands substantial structural modeling. Generative models like VulRepair ( Fu et al. 2022 ) and Zero-Shot Repair ( Pearce et al. 2023 ) utilize large pre-trained language models (e.g., T5, Codex) to rewrite buggy code into secure versions. However, these methods focus on repair rather than detection and often depend on test suites, human oversight, or complex prompts. In contrast, data centric approaches such as VULGEN ( Nong et al. 2023 ) and VGX ( Nong et al. 2024 ) generate synthetic vulnerable code via contextual transformations, while UL-VAE ( Ambekar and Thokchom 2024 ) applies unsupervised anomaly detection to identify zero-day patterns in IoT malware. CLNX ( Qin et al. 2025 ) improves CodeBERT’s robustness by incorporating commit context, and augmentation strategies help reduce overfitting in models like GraphCodeBERT. Despite these advances, most existing methods operate on vulnerable code snapshots, commit diffs, or symbolic traces of unpatched code. In contrast, our work explores whether patched functions assumed secure may still contain latent indicators of vulnerabilities, posing risks of re-emergent or zero-day exploits. In this work, we pose a central question: Can latent vulnerability patterns persist in patched functions previously considered secure thereby introducing future zero-day risks? To investigate this, we introduce HYDRA , a hybrid prediction framework to improve post-patch software security testing, that combines domain-driven heuristic rules with semantic embeddings from a pre-trained model. Motivated by prior findings on hidden or misclassified patches in open-source software ( Wang et al. 2019 ) and the significance of silent fixes in long term code maintenance ( Zakharov and Gladkikh 2024 ) , we hypothesize that many patches may leave behind residual vulnerabilities either due to incomplete remediation or rushed developer fixes. HYDRA is designed to uncover these overlooked risks by integrating two complementary components: (a). Symbolic pattern matching , based on five manually defined heuristic rules implemented using regular expressions (regex), and (b). Semantic embeddings generated from GraphCodeBERT ( Guo et al. 2020 ) , which captures both token level context and data flow graph (DFG) information. While

Read the complete text