Skip to content

[BUG] Relationships in SPDX sbom pointing in wrong direction #6867

@antonbauhofer

Description

@antonbauhofer

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

When creating an SPDX sbom, some of the contained relationships are incorrect.
For example, for the npm/cli repository, the following relationship is determined:
{
"spdxElementId": "SPDXRef-Package-npm-10.1.0",
"relatedSpdxElement": "SPDXRef-Package-npmcli.eslint-config-4.0.2",
"relationshipType": "DEV_DEPENDENCY_OF"
}

Expected Behavior

According to the SPDX specification, the relationship should point in the other direction:
{
"spdxElementId": "SPDXRef-Package-npmcli.eslint-config-4.0.2",
"relatedSpdxElement": "SPDXRef-Package-npm-10.1.0",
"relationshipType": "DEV_DEPENDENCY_OF"
}

Steps To Reproduce

  1. Clone the latest unstable master of npm/cli repository according to the contributing manual
  2. Create an SPDX sbom with node . sbom --sbom-format spdx
  3. Search for any relationships with "relationshipType": "DEV_DEPENDENCY_OF"
  4. Compare the identified relationships with those specified in the respective package.json files

Environment

  • npm: 10.2.0
  • Node.js: 18.12.1
  • OS Name: macOS Ventura 13.4
  • System Model Name: Irrelevant
  • npm config: Irrelevant

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions