Code Ownership in Open-Source AI Software Security

Jiawen Wen, Dong Yuan, Lei Ma, Huaming Chen

As open-source AI frameworks like TensorFlow and PyTorch become the backbone of modern technology, a critical question emerges: Does the way we collaborate on code impact how secure that code actually is?

In their paper, "Code Ownership in Open-Source AI Software Security," Jiawen Wen and colleagues from the University of Sydney, University of Alberta, and the University of Tokyo investigate the link between developer contribution patterns and software vulnerabilities. By introducing novel "time-based" metrics, they provide a new lens through which we can view the security health of the AI ecosystem.

TL;DR

The researchers found a strong correlation between "code ownership"—the distribution of contributions among developers—and the presence of vulnerabilities in major AI projects. Specifically, projects with a high proportion of "minor contributors" (those responsible for less than 10% of a file) are significantly more likely to harbor security flaws.

What Problem Does This Paper Address?

Open-source software thrives on community contribution, but this transparency is a double-edged sword. While more eyes can find bugs, a high churn of anonymous or infrequent contributors can introduce "latent vulnerabilities."

Traditional security metrics often focus on code complexity or the sheer volume of changes (churn). However, these don't always capture the human element: Who is writing the code, and how well do they know the component they are touching? This paper seeks to bridge that gap by quantifying "code ownership" and testing whether it can predict security risks better than classic software metrics in the specific context of AI software.

Methods

The authors leveraged a multi-pronged approach to analyze five prominent open-source AI projects. Their methodology included:

  • Code Ownership Metrics: They defined "ownership" as the ratio of an individual's commits to the total commits for a specific file. A key metric is the Minor Contributor—a developer who holds less than a 10% ownership stake in a component.
  • Novel Time and Release Metrics: Moving beyond simple "pre-release" vs. "post-release" categories, the authors introduced:
  • Time Stages (T1-T5): Categorizing code based on its lifespan (from <7 days to >3 years).
  • OSS Stages: A 6-tier maturity model (e.g., "Success Growth" vs. "Tragedy Initiation") based on release frequency and developer activity.
  • Quantitative Analysis: Using Pearson, Spearman, and Kendall correlation methods, they tested the relationship between these ownership/time metrics and known vulnerabilities.
  • Tool Development: They implemented a Python-based command-line tool to help project maintainers calculate these metrics for their own repositories.

Datasets

The study conducted a large-scale empirical analysis using a dataset of 39,323 records (27,075 vulnerable and 12,248 non-vulnerable entries) pulled from:

  • NVD (National Vulnerability Database): For CVE details and severity scores.
  • GitHub Repositories: Specifically targeting five "heavyweight" AI projects: TensorFlow, Caffe, OpenCV, Keras, and PyTorch.

Key Insights and Ideas

  • The "Minor Contributor" Red Flag: The most striking insight is that a high number of minor contributors is a potent predictor of vulnerabilities. When many people make small, disconnected changes to a file, the lack of a "master owner" who understands the full context leads to security oversights.
  • AI Software's Unique Lifecycle: The researchers found that AI projects don't follow the same security patterns as traditional operating systems (like Windows). For AI, vulnerabilities are better understood through "Time Stages"—as a project matures and the "Days Difference" (time since project start) increases, the likelihood of finding new vulnerabilities actually shifts.
  • Ownership vs. Classic Metrics: Code ownership metrics consistently outperformed classic metrics like file size or churn rate in predicting security flaws. In their regression models, combining ownership data with time-based metrics improved the model's explanatory power (Adjusted R-squared) by 33%.

Key Results

  • Negative Correlation with Ownership: There is a pronounced negative correlation (-0.62 Spearman) between high ownership and vulnerability. In simpler terms: Stronger ownership = fewer defects.
  • Vulnerability Severity: The study found that as a project ages and the number of releases grows, the severity of the vulnerabilities discovered tends to increase.
  • Optimal Threshold: Through rigorous testing, the authors determined that 10% is the optimal threshold for defining a "minor contributor" when assessing security risk.
  • Independence of Locality: Interestingly, the study found that where a file is located in the project hierarchy doesn't matter as much as who is working on it.

Limitations and Future Work

While the findings are robust for the five projects studied, the authors acknowledge several areas for further exploration:

  • Supply Chain Risks: The current study focuses on internal code ownership but doesn't deeply account for vulnerabilities introduced via external dependencies (outdated libraries, etc.).
  • Language and Complexity: The exclusion of deep code complexity analysis across different programming languages (C++ vs. Python) might miss some nuances.
  • Generalizability: While these five projects are massive, they might not represent the entire "long tail" of smaller, niche open-source AI tools.

The authors suggest that future work should integrate these ownership metrics with automated "dependency management" tools to create a more holistic security framework for the AI supply chain.

Summary updated

BibTeX
@inproceedings{wen2024code,
  author = {Jiawen Wen and Dong Yuan and Lei Ma and Huaming Chen},
  title = {{Code Ownership in Open-Source AI Software Security}},
  booktitle = {RAIE@ICSE},
  year = {2024},
  doi = {10.1145/3643691.3648586},
}

Loading related content...

Figure