Feature Engineering Is the Bottleneck: An Explainability Study of ML-Based Security-Relevant Method Detection
Year: 2026
Type: preprint
Abstract: Static Application Security Testing tools trace untrusted data flows using curated lists of Security-Relevant Methods (SRMs), namely sources, sinks and sanitizers. Machine learning approaches for SRM detection (ML4SRM) report strong cross-validation results yet perform far worse on unseen code, and prior work has not asked why. To assess this disparity we develop WEAVE, a tool combining automated model selection, repeated cross-validation and explainable Artificial intelligence (XAI) using SHapley Additive exPlanations (SHAP) for WEKA/MEKA pipelines. Using WEAVE and SRM-Dataset, our consolidated collection of 10{,}180 Java SRMs, we conduct an explanation study of three ML4SRM approaches, namely, Dev-Assist, SSCM, and SWAN. Global and local explanations show that the models rely on identifier tokens and parameter signatures, barely on the method body, so they learn dependencies among surface features specific to the training data. On unseen code the models read those same features differently, with 43 of 59 feature group and model combinations shifting significantly, by up to 62 percentage points, and 14 pointing the opposite way for most methods. Nothing inside the models changes. An attribution is a per-instance quantity averaged over the methods explained, not a weight stored in the model, so one fixed decision function can be read two ways. AutoML, included as a control, raises F1 yet broadens feature use in only four of the seven models, while aggregate metrics hide the instability, with micro-F1 at 0.99 where minority-class F1 is 0.15. Feature engineering, not model selection, is therefore the bottleneck for SRM detection. Progress depends on features that survive renaming, obfuscation stress tests, and per-class metrics alongside aggregate scores.
Source: Research Square
Language: English
Subfield: Software
Field: Computer Science
Domain: Physical Sciences
Open Access status: green
OpenAlex ID: W7225868666
