Skip to content

BUG: DejaCode exported CycloneDX SBOM does not retain dependency relationship #271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ghsa-retrieval opened this issue Feb 25, 2025 · 2 comments
Labels
bug Something isn't working design needed Design details needed to complete the issue enhancement New feature or request HighPriority High Priority

Comments

@ghsa-retrieval
Copy link

ghsa-retrieval commented Feb 25, 2025

Describe the bug
Current DejaCode versions already represent the relationships between packages in a product's inventory and their dependencies with other packages. However, when exporting an SBOM that relationship is not correctly represented in the resulting file. This was tested with CycloneDX as output format.

The resulting file list all packages as if they are direct dependencies. This is incorrect, has some may only be transitive dependencies. This is highly important to get right for regulatory purposes as it indicates who is responsible for fixing issues or updating versions. If it is a direct dependency then the organisation developing the product is directly responsible. However, if a dependency of the product has transitive dependencies where a package is outdated, then the organisation developing the product may have to wait for a patch of that dependency to be released. Furthermore, displaying transitive dependencies as direct dependencies is simply inaccurate for the purpose of software component analysis.

To Reproduce

  1. Create a product in DejaCode
  2. Generate an SBOM for a product with a tool such as cdxgen, where there are transitive dependencies
  3. Use "Actions > Load packages from SBOMs" with "Scan all packages of this product post-import" checked
  4. Once the import is completed you should see the inventory populated and dependencies filled
  5. Use "Share > CycloneDX" to export an SBOM in format version 1.6
  6. Open the SBOM in an editor of your choice an see that all packages are listed as direct dependencies under the key "dependencies" and within that "dependsOn".

Expected behavior
Instead of having all packages listed in "dependsOn" as direct dependencies, they should be listed as follow:

  • All dependencies should each have an entry like:
    {
        "ref": "pkg:pkgmanager/example@1.0.0",
        "dependsOn": []
    },
    
  • "dependsOn" should reference the PURLs of other packages that they depend on, if any (just like dependencies already do in DejaCode's internal model)

Important: The SBOM import must also ensure that only direct dependencies are listed as packages in the inventory and indirect/transitive dependencies are listed as dependecies. Otherwise this cannot be fixed afterwards. Hence, this issue is related to #122

Screenshots
n.a.

Context (OS, Browser, Device, etc.):
n.a.

@ghsa-retrieval ghsa-retrieval added bug Something isn't working design needed Design details needed to complete the issue enhancement New feature or request labels Feb 25, 2025
@ghsa-retrieval
Copy link
Author

Sorry if this ticket is too similar or has too much overlap.

@DennisClark DennisClark added the HighPriority High Priority label Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working design needed Design details needed to complete the issue enhancement New feature or request HighPriority High Priority
Projects
None yet
Development

No branches or pull requests

3 participants