[BUG] invalid CycloneDX generated for package with git reference

Đang mở
#10,367 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@mvanhorn đang làm issue này rồi.

Từ ngày 28/11/2026.

  • #10378 của @mvanhorn — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, node.js
Lĩnh vực
devtools

Hướng nghiên cứu

Start with the CycloneDX SBOM generation path and its tests; the issue does not name specific files, so trace the npm sbom --sbom-format=cyclonedx entry point. Reproduce with a dependency whose repository URL uses the [email protected]: form and inspect the generated externalReferences. Done means the generated SBOM passes CycloneDX validation and handles the invalid URL as described.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Bug Needs Triage
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
This is not just a request to bump a dependency for a CVE
  • This is not solely a request to bump a dependency for a CVE
Current Behavior

using NODE_ENV=production npm sbom --sbom-format=cyclonedx I am generating a SBOM for my package.json:

{
  "name": "my-project",
  "version": "1.0.0",
  "type": "module",
  "dependencies": {
    "glob": "^14.0.6"
  }
}

per schema validator the generated sbom has a invalid schema

sbom.json

validation error:

Validation failed. One invalid URL remains in sbom.json:79 for [email protected]:
[email protected]:isaacs/node-glob.git
Replace it with https://github.com/isaacs/node-glob.git.
Expected Behavior

the generated sbom should be valid according to the CycloneDX schema.
I think npm should not take the invalid url into the final result and instead e.g. emit a warning and skip the invalid data.

Steps To Reproduce
  1. create a package.json with the aboves content
  2. run NODE_ENV=production npm sbom --sbom-format=cyclonedx > sbom.json

-> the generated sbom should not contain [email protected]:isaacs/node-glob.git as a externalReferences because its not a valid http url

Environment
  • npm: 12.2.3
  • Node.js: v26.13.1
  • OS Name: macOS Golden Gate 27.2.1 (26B131)
  • System Model Name: Apple M4 Pro
Ngôn ngữ chính
JavaScript
Star
10.3k
Fork
5k
Merge trung bình
4 ngày 11 giờ
Pull request đã merge (30 ngày)
26

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của npm/cli

Tất cả issue của npm/cli

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.