Skip to main content
QUICK REVIEW

[Paper Review] Misleading Authorship Attribution of Source Code using Adversarial Learning

Erwin Quiring, Alwin Maier|arXiv (Cornell University)|May 29, 2019
Advanced Malware Detection TechniquesComputer Science41 citations
TL;DR

This paper presents a black-box adversarial attack on machine-learning based source-code authorship attribution. It uses semantics-preserving code transformations guided by Monte-Carlo tree search to mislead classifiers, achieving large drops in accuracy and enabling impersonation.

ABSTRACT

In this paper, we present a novel attack against authorship attribution of source code. We exploit that recent attribution methods rest on machine learning and thus can be deceived by adversarial examples of source code. Our attack performs a series of semantics-preserving code transformations that mislead learning-based attribution but appear plausible to a developer. The attack is guided by Monte-Carlo tree search that enables us to operate in the discrete domain of source code. In an empirical evaluation with source code from 204 programmers, we demonstrate that our attack has a substantial effect on two recent attribution methods, whose accuracy drops from over 88% to 1% under attack. Furthermore, we show that our attack can imitate the coding style of developers with high accuracy and thereby induce false attributions. We conclude that current approaches for authorship attribution are inappropriate for practical application and there is a need for resilient analysis techniques.

Motivation & Objective

  • Motivate and evaluate the robustness of ML-based source code authorship attribution.
  • Demonstrate that semantics-preserving, transformations can mislead attribution methods.
  • Propose a black-box attack framework combining code transformations with Monte-Carlo tree search.
  • Assess the feasibility of untargeted and targeted impersonation attacks on real programmer data.

Proposed method

  • Develop semantics-preserving code transformations using Clang front-end across five transformation families.
  • Represent code with AST, CFG with use-define chains, and declaration-reference mappings to enable safe transformations.
  • Construct a transformation sequence via Monte-Carlo tree search to reach a target in feature space without breaking semantics.
  • Operate under a black-box threat model that only uses classifier outputs for guidance.
  • Evaluate untargeted and targeted attacks on two attribution methods (Caliskan et al. RF and Abuhamad et al. LSTM) using a Google Code Jam dataset.

Experimental results

Research questions

  • RQ1Can a black-box adversary meaningfully reduce accuracy of ML-based source code authorship attribution?
  • RQ2Are untargeted attacks (dodging) effective at misleading attribution to any other author?
  • RQ3Are targeted impersonation attacks feasible, enabling attribution to a chosen developer?
  • RQ4How do code transformations preserve semantics while altering stylistic features used for attribution?
  • RQ5What is the practicality and plausibility of transformed code to hide manipulation while remaining legitimate?

Key findings

  • Attack reduces accuracy of two recent attribution methods from over 88% to 1%.
  • Targeted impersonation achieves 77%–81% success rate across developers on average.
  • A 15-participant study indicates transformed code remains plausible and hard to distinguish from unmodified code.
  • Experiment setup uses 1,632 C++ files from 204 authors solving 8 GCJ challenges, with k-fold cross-validation across challenges.
  • Transformations are solely lexical/syntactic (no layout changes) and rely on a large set of 36 transformers organized into five families.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.