On the Correctness of Metadata-Based SBOM Generation: A Differential Analysis Approach

Sheng Yu, Wei Song, Xunchao Hu, Heng Yin2024

Abstract

Amidst rising concerns of software supply chain attacks, the Software Bill of Materials (SBOM) has emerged as a pivotal tool, offering a detailed listing of software components to manage vulnerabilities, dependencies, and licensing. While many SBOM generation tools are extensively used in both commercial and open-source realms, the correctness of these tools remains largely unscrutinized. To date, there has not been a systematic study addressing the correctness of contemporary SBOM generation solutions. In this paper, we conduct a large-scale differential analysis of the correctness of four popular SBOM generators. Surprisingly, our evaluation reveals all four SBOM generators exhibit inconsistent SBOMs and dependency omissions, leading to incomplete and potentially inaccurate SBOMs. Moreover, we construct a parser confusion attack against these tools, introducing a new attack vector to conceal malicious, vulnerable, or illegal packages within the software supply chain. Drawing from our analysis, we propose best practices for SBOM generation and introduce a benchmark to steer the development of more robust SBOM generators.

Introduction

Software Bill of Materials (SBOM) tools are often described as the "nutrition labels" of the software world. In the wake of massive supply chain attacks like SolarWinds, the industry has turned to SBOMs—formal records of all components and dependencies—to manage security risks. The logic is simple: if you don't know a library exists in your code, you cannot patch it when a vulnerability is discovered.

However, this security posture relies on a dangerous assumption: that the tools used to generate these SBOMs are accurate. This research addresses a critical gap by scrutinizing the correctness of popular SBOM generators. If a generator misses a dependency (a false negative), it provides a "false assurance of security," leaving backdoors open that security teams will never investigate.

Methodology and Datasets

The researchers employed a large-scale differential analysis approach, comparing the outputs of four popular SBOM generators: Trivy, Syft, Microsoft SBOM Tool, and GitHub Dependency Graph. Since no universal "ground truth" exists for every project, the study used Jaccard similarity to measure tool agreement and created a manual ground truth for Python projects by "dry-running" actual package managers (e.g., pip install).

The study analyzed 7,876 high-quality open-source projects from GitHub, spanning nine major programming languages, including Python, Ruby, Java, Rust, and Go. To facilitate further research, the authors introduced the SBOM-benchmark, a publicly available dataset of manually crafted metadata files designed to test tool performance on complex syntax and "corner cases."

Figure 1: Package count distribution across Rust repositories, demonstrating that tool inconsistency is a cross-language phenomenon.

Key Insights: The Parser Problem and Confusion Attacks

The analysis revealed several fundamental issues in how SBOM tools operate:

  • The Parser Problem: Most tools avoid using actual language package managers, opting instead for custom-built metadata parsers. These parsers often fail to support the full, complex syntax of files like requirements.txt, leading to significant blind spots.
  • Lockfiles vs. Raw Metadata: While tools are generally effective at reading "lockfiles" (exact versions), they struggle significantly with "raw" metadata (version ranges).
  • Parser Confusion as an Attack Vector: The researchers discovered they could hide malicious packages from SBOM tools using simple syntax tricks, such as backslashes (\) for line continuation. While the package manager correctly identifies and installs the dependency, the SBOM tool misses it entirely.
  • Naming Inconsistency: There is no industry consensus on package naming conventions (e.g., using dots vs. colons to join IDs), which prevents downstream tools from accurately matching components against vulnerability databases.

Empirical Results

The evaluation yielded concerning results regarding tool accuracy and consistency. On Python requirements.txt files, most tools failed to detect over 90% of actual dependencies. Trivy and Syft, for instance, showed a recall of only 0.10. The Microsoft SBOM Tool performed best (0.73) because it queries package managers rather than relying solely on text parsing.

Figure 2: Package count distribution across Python repositories, highlighting the significant variation between tools.

Furthermore, the study found that approximately 74% of Python dependencies are transitive. Most tools failed to capture these unless a lockfile was present. Additionally, over 10% of detected dependencies were duplicates, often because tools failed to merge information from multiple metadata files within the same repository.

Conclusion and Future Work

This study highlights that current SBOM generation is far from a solved problem. The reliance on custom parsers rather than native package managers creates significant security gaps and opens the door for adversarial "parser confusion" attacks.

The authors advocate for "Package Manager Dry Runs" as a best practice to ensure SBOMs reflect the actual installed environment. Future work includes expanding the benchmark to more languages and developing a qualitative ranking system to help security professionals select the most robust tools for their supply chain management.

Summary updated

Abstract

Amidst rising concerns of software supply chain attacks, the Software Bill of Materials (SBOM) has emerged as a pivotal tool, offering a detailed listing of software components to manage vulnerabilities, dependencies, and licensing. While many SBOM generation tools are extensively used in both commercial and open-source realms, the correctness of these tools remains largely unscrutinized. To date, there has not been a systematic study addressing the correctness of contemporary SBOM generation solutions. In this paper, we conduct a large-scale differential analysis of the correctness of four popular SBOM generators. Surprisingly, our evaluation reveals all four SBOM generators exhibit inconsistent SBOMs and dependency omissions, leading to incomplete and potentially inaccurate SBOMs. Moreover, we construct a parser confusion attack against these tools, introducing a new attack vector to conceal malicious, vulnerable, or illegal packages within the software supply chain. Drawing from our analysis, we propose best practices for SBOM generation and introduce a benchmark to steer the development of more robust SBOM generators.
BibTeX
@misc{yu2024correctness,
  author = {Sheng Yu and Wei Song and Xunchao Hu and Heng Yin},
  title = {{On the Correctness of Metadata-Based SBOM Generation: A Differential Analysis Approach}},
  year = {2024},
  doi = {10.1109/dsn58291.2024.00018},
}

Loading related content...

Figure