Preserving Privacy in Software Composition Analysis: A Study of Technical Solutions and Enhancements

Huaijin Wang, Zhibo Liu, Yanbo Dai, Shuai Wang, Qiyi Tang, Sen Nie, Shi Wu

TL;DR

Software Composition Analysis (SCA) currently forces a "privacy dilemma" where either the user leaks their proprietary code or the vendor leaks their valuable database. This paper introduces SAFESCA, a framework that uses Multi-Party Computation (MPC) optimized by program analysis filters to provide strong privacy guarantees for both parties with a manageable 23x overhead—a significant leap from the 184x overhead of naive encrypted solutions.

What Problem Does This Paper Address?

SCA is the process of identifying open-source software (OSS) components within an application to manage security vulnerabilities and license compliance. However, it faces a major adoption hurdle: privacy.

In a typical industrial setup, a customer must upload their source code to a vendor's server. This risks leaking trade secrets or proprietary algorithms. Conversely, if the vendor allows the customer to run the analysis locally, they must share their "crown jewels"—the massive, painstakingly curated OSS database and proprietary detection models.

Existing workarounds, like binary-based SCA, often suffer from poor accuracy. The authors set out to solve this "privacy tug-of-war" by finding a way to perform high-accuracy SCA where neither side sees the other's raw data.

Methods

The authors systematically explored two main privacy-preserving paradigms:

  1. Similarity-Based Bucketization (SBB): A lightweight technique that adds noise to data. While fast, the authors proved it is vulnerable to statistical inference attacks, allowing a curious vendor to "guess" the client's components.
  2. Multi-Party Computation (MPC): Using the CrypTen framework, they implemented an SCA pipeline where data is cryptographically shared between two parties. No raw data is ever revealed, only the final result.

To make the heavy computational cost of MPC practical, they developed SAFESCA, which introduces three "Client-Side Filters" to reduce the volume of data requiring expensive encrypted computation:

  • Symbol Filter: Identifies obvious matches using unique function names and call-graph relationships.
  • Informative Source Function Filter: Uses a "maintainability index" to skip trivial or boilerplate functions that don't help in identifying unique components.
  • Assembly Function Filter: Specifically for binary inputs, it selects representative functions based on complexity and uniqueness.

They also upgraded the underlying detection engine from simple hashing (TLSH) to DPCNN (Deep Parallel Convolutional Neural Networks) for more robust code embeddings.

Datasets

  • OSS Database: The authors constructed a new, large-scale database by crawling 1,832 C/C++ repositories from GitHub (totaling over 800 GB).
  • Evaluation Dataset: They curated a ground-truth dataset of 14 complex binaries (including projects like mod_pagespeed) with 211 identified OSS dependencies. This was a manual effort involving 40 man-hours to ensure high-quality labels.

Key Insights and Ideas

  • The "Aha" Moment on Efficiency: The authors realized that most functions in a codebase are "uninformative" for SCA (e.g., simple getters/setters or common boilerplate). By using program analysis to filter these out before they hit the MPC layer, they could achieve nearly the same accuracy while only encrypting ~5% of the total functions.
  • SBB is Not Enough: The study provides a cautionary tale for "lightweight" privacy. They demonstrated that even with mutation and noise, a vendor could rank OSS projects by the size of returned "buckets" to accurately predict what the client was using.
  • The Power of Weights: By assigning weights to functions (longer, rarer functions get higher weights), they significantly improved the F1 score of the underlying SCA engine compared to traditional methods like CENTRIS.

Key Results

  • Accuracy: SAFESCA achieved an F1 score of 0.809, which is comparable to (and in some cases better than) state-of-the-art non-private SCA tools.
  • Performance: Naive MPC-based SCA incurred a massive 184x overhead. SAFESCA’s optimizations reduced this to 23x.
  • Practicality: For a large real-world binary like mod_pagespeed (543 MB), SAFESCA completed the entire privacy-preserving analysis in 72 minutes. While slower than plaintext analysis, this is considered a "plausible" timeframe for a security audit.
  • Privacy: Unlike SBB, the MPC-based approach offers a principled guarantee that no information about the client's code or the vendor's model is leaked during the process.

Limitations and Future Work

  • Generative Code Reuse: The authors noted a "rare" type of reuse where code is generated dynamically by scripts (e.g., glad). Current SCA signatures struggle to track these because the code doesn't exist in the static OSS repository.
  • Model Stealing: While the database is protected, a malicious client could theoretically try to reconstruct the vendor's model by sending millions of queries. The authors suggest that the high overhead of MPC actually acts as a natural deterrent here, but more formal "model-stealing" defenses could be integrated.
  • Database Gaps: Even with 1,800+ projects, the database is not exhaustive. Future work involves scaling the signature generation process to cover even more of the OSS ecosystem.

Summary updated

BibTeX
@inproceedings{wang2025preserving,
  author = {Huaijin Wang and Zhibo Liu and Yanbo Dai and Shuai Wang and Qiyi Tang and Sen Nie and Shi Wu},
  title = {{Preserving Privacy in Software Composition Analysis: A Study of Technical Solutions and Enhancements}},
  booktitle = {ICSE},
  year = {2025},
  doi = {10.1109/icse55347.2025.00055},
}
Figure