Generating Adversarial Computer Programs using Optimized Obfuscations

Shashank Srikant, Sijia Liu, Tamara Mitrovska, Shiyu Chang, Quanfu Fan +2 more
3/18/2021
cs.LGcs.PLcs.SE

Official code: ALFA-group/adversarial-code-generation (31 stars, Python, last commit 2021-11-15).

Abstract

Machine learning (ML) models that learn and predict properties of computer programs are increasingly being adopted and deployed. These models have demonstrated success in applications such as auto-completing code, summarizing large programs, and detecting bugs and malware in programs.

Show full abstract

In this work, we investigate principled ways to adversarially perturb a computer program to fool such learned models, and thus determine their adversarial robustness. We use program obfuscations, which have conventionally been used to avoid attempts at reverse engineering programs, as adversarial perturbations. These perturbations modify programs in ways that do not alter their functionality but can be crafted to deceive an ML model when making a decision. We provide a general formulation for an adversarial program that allows applying multiple obfuscation transformations to a program in any language. We develop first-order optimization algorithms to efficiently determine two key aspects -- which parts of the program to transform, and what transformations to use. We show that it is important to optimize both these aspects to generate the best adversarially perturbed program. Due to the discrete nature of this problem, we also propose using randomized smoothing to improve the attack loss landscape to ease optimization. We evaluate our work on Python and Java programs on the problem of program summarization. We show that our best attack proposal achieves a $52\%$ improvement over a state-of-the-art attack generation approach for programs trained on a seq2seq model. We further show that our formulation is better at training models that are robust to adversarial attacks.

View on arXivView PDF

Code Implementations(1)

[ICLR 2021] "Generating Adversarial Computer Programs using Optimized Obfuscations" by Shashank Srikant, Sijia Liu, Tamara Mitrovska, Shiyu Chang, Quanfu Fan, Gaoyuan Zhang, and Una-May O'Reilly

315Python, ShellMar 14, 20215 years ago
adversarial-machine-learningai4codebig-codecode2seqcombinatorial-optimization+5 more

Similar Papers

Cite this paper

@article{srikant2021generating,
  title  = {Generating Adversarial Computer Programs using Optimized Obfuscations},
  author = {Shashank Srikant and Sijia Liu and Tamara Mitrovska and Shiyu Chang and Quanfu Fan and Gaoyuan Zhang and Una-May O'Reilly},
  year   = {2021},
  eprint = {2103.11882},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2103.11882}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2103.11882.svg)](https://codeofpaper.com/paper/2103.11882)

Discussion