[Paper Review] Vulnerability Mimicking Mutants
This paper introduces VMMS, a machine learning approach that identifies vulnerability-mimicking mutants—code mutations generated by pre-trained language models like CodeBERT that semantically replicate the behavior of real security vulnerabilities. Despite constituting only 3.9% of all mutants, these vulnerability-mimicking mutants successfully replicate the failure behavior of 55.6% of 45 analyzed vulnerabilities, and VMMS predicts them with 0.63 MCC, 0.80 precision, and 0.51 recall, demonstrating the feasibility of static prediction without manual feature engineering.
With the increasing release of powerful language models trained on large code corpus (e.g. CodeBERT was trained on 6.4 million programs), a new family of mutation testing tools has arisen with the promise to generate more "natural" mutants in the sense that the mutated code aims at following the implicit rules and coding conventions typically produced by programmers. In this paper, we study to what extent the mutants produced by language models can semantically mimic the observable behavior of security-related vulnerabilities (a.k.a. Vulnerability-mimicking Mutants), so that designing test cases that are failed by these mutants will help in tackling mimicked vulnerabilities. Since analyzing and running mutants is computationally expensive, it is important to prioritize those mutants that are more likely to be vulnerability mimicking prior to any analysis or test execution. Taking this into account, we introduce VMMS, a machine learning based approach that automatically extracts the features from mutants and predicts the ones that mimic vulnerabilities. We conducted our experiments on a dataset of 45 vulnerabilities and found that 16.6% of the mutants fail one or more tests that are failed by 88.9% of the respective vulnerabilities. More precisely, 3.9% of the mutants from the entire mutant set are vulnerability-mimicking mutants that mimic 55.6% of the vulnerabilities. Despite the scarcity, VMMS predicts vulnerability-mimicking mutants with 0.63 MCC, 0.80 Precision, and 0.51 Recall, demonstrating that the features of vulnerability-mimicking mutants can be automatically learned by machine learning models to statically predict these without the need of investing effort in defining such features.
Motivation & Objective
- To investigate whether language model-based mutation testing tools can generate mutants that semantically mimic real security vulnerabilities.
- To address the high cost of analyzing all mutants by identifying a minimal set of vulnerability-mimicking mutants prior to execution.
- To develop a static, machine learning-based method that predicts vulnerability-mimicking mutants without requiring manual feature engineering.
- To evaluate the effectiveness of such prediction in identifying mutants that fail the same tests as real vulnerabilities (Proof of Vulnerability).
Proposed method
- The study uses the pre-trained CodeBERT model to generate mutants via masked token prediction, as implemented in the μBERT tool.
- Mutants are evaluated by checking test suite failures against the Proof of Vulnerability (PoV) tests for each vulnerability.
- A set of 45 reproducible vulnerabilities from the Vul4J dataset is used as ground truth for failure behavior.
- Features are automatically extracted from mutant code context, including syntactic, semantic, and structural properties.
- A machine learning model (random forest) is trained on these features to classify mutants as vulnerability-mimicking or not.
- The model is evaluated using the Ochiai coefficient to measure similarity between mutant and vulnerability failure patterns.

Experimental results
Research questions
- RQ1To what extent can language model-generated mutants semantically mimic real security vulnerabilities in terms of test failure behavior?
- RQ2Can a machine learning model accurately predict which mutants are vulnerability-mimicking without manual feature engineering?
- RQ3How effective is the proposed VMMS approach in identifying vulnerability-mimicking mutants compared to baseline methods?
- RQ4What proportion of the total mutant set consists of vulnerability-mimicking mutants, and how many vulnerabilities do they represent?
Key findings
- 16.6% of all mutants fail at least one test that is also failed by the corresponding vulnerability, indicating that such mutants are detectable in practice.
- Only 3.9% of the total mutant set are vulnerability-mimicking mutants, highlighting their scarcity despite their relevance.
- These vulnerability-mimicking mutants account for 55.6% of the 45 analyzed vulnerabilities, showing significant coverage of real security issues.
- VMMS achieves a Matthews Correlation Coefficient (MCC) of 0.63, indicating moderate to strong predictive performance.
- The model achieves 0.80 precision, meaning 80% of predicted vulnerability-mimicking mutants are indeed semantically similar to real vulnerabilities.
- Recall is 0.51, indicating that the model identifies about half of the actual vulnerability-mimicking mutants in the dataset.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.