TY - JOUR U1 - Zeitschriftenartikel, wissenschaftlich - begutachtet (reviewed) A1 - Schuckert, Felix A1 - Katt, Basel A1 - Langweg, Hanno T1 - Insecurity Refactoring: Automated Injection of Vulnerabilities in Source Code JF - Computers & Security N2 - Insecurity Refactoring is a change to the internal structure of software to inject a vulnerability without changing the observable behavior in a normal use case scenario. An implementation of Insecurity Refactoring is formally explained to inject vulnerabilities in source code projects by using static code analysis. It creates learning examples with source code patterns from known vulnerabilities. Insecurity Refactoring is achieved by creating an Adversary Controlled Input Dataflow tree based on a Code Property Graph. The tree is used to find possible injection paths. Transformation of the possible injection paths allows to inject vulnerabilities. Insertion of data flow patterns introduces different code patterns from related Common Vulnerabilities and Exposures (CVE) reports. The approach is evaluated on 307 open source projects. Additionally, insecurity-refactored projects are deployed in virtual machines to be used as learning examples. Different static code analysis tools, dynamic tools and manual inspections are used with modified projects to confirm the presence of vulnerabilities. The results show that in 8.1% of the open source projects it is possible to inject vulnerabilities. Different inspected code patterns from CVE reports can be inserted using corresponding data flow patterns. Furthermore the results reveal that the injected vulnerabilities are useful for a small sample size of attendees (n=16). Insecurity Refactoring is useful to automatically generate learning examples to improve software security training. It uses real projects as base whereas the injected vulnerabilities stem from real CVE reports. This makes the injected vulnerabilities unique and realistic. KW - Web security KW - Static code analysis KW - Refactoring KW - Vulnerability Pattern KW - PHP KW - SQLi KW - XSS Y1 - 2023 SN - 0167-4048 SS - 0167-4048 U6 - https://doi.org/10.1016/j.cose.2023.103121 DO - https://doi.org/10.1016/j.cose.2023.103121 VL - 128 SP - 18 S1 - 18 PB - Elsevier ER -