DependencyTrack / DependencyTrack/dependency-track

bom-ref, Description, PURL (and maybe also other information) is not taken from BOM

Open
#2,373 8 comments 0 reactions 0 assignees View on GitHub
cdx-1.4 enhancement p2
Dominant language
Java
Stars
4.2k
Forks
811
Avg merge
8h 39m
Merged PRs (30d)
237

Description

### Current Behavior

I put a BOM to Dependency Track using the REST-API like this (Windows-Curl):
```
curl "http://dockerhost02:8081/api/v1/bom" -H "Content-Type: multipart/form-data" -H "X-API-Key: MYAPIKeY" -F "autoCreate=true" -F "projectName=JustATestClassLibrary" -F "projectVersion=1.0.0" -F "bom=@SBOM\bom-postprocessed.xml" --request POST
```
In general, the Project is created including a vulnerable library (intended), which is also found.

BUT, neither the BOM-REF and PURL nor the DESCRIPTION is taken.
See here:
![image](https://user-images.githubusercontent.com/61045115/212102329-92d183e8-36ca-4787-9655-1233fe9a7618.png)
![image](https://user-images.githubusercontent.com/61045115/212102421-9aa4905f-fca2-42d8-8020-fca54226007a.png)

My CycloneDX-File looks like this:
```




CycloneDX
CycloneDX module for .NET
2.7.0.0



JustATestClassLibrary
1.0.0
pkg:nuget/JustATestClassLibrary@1.0.0
JustATestClassLibrary Description




James Newton-King
Newtonsoft.Json
4.0.1
Json.NET is a popular high-performance JSON framework for .NET
required

C7A076A8455F603C1F216AE85AD4BAF7647C5592D0783BB7D1EF93ADCA03E795AEFB497245255BE15586E84258B268D97E2A8CFCC33732B454C193D0EB002027




pkg:nuget/Newtonsoft.Json@4.0.1


http://james.newtonking.com/projects/json-net.aspx









```

And even the `bom-ref` looks like not to be taken over.
If I do a download of the bom from this project/version I get:
![image](https://user-images.githubusercontent.com/61045115/212103051-81b1f12b-db0e-4dd1-be8d-5d5d2b52d69e.png)
```
{
"bomFormat" : "CycloneDX",
"specVersion" : "1.4",
"serialNumber" : "urn:uuid:66782919-4674-42d2-a13e-ef2f23d5c68f",
"version" : 1,
"metadata" : {
"timestamp" : "2023-01-12T15:08:24Z",
"tools" : [
{
"vendor" : "OWASP",
"name" : "Dependency-Track",
"version" : "4.7.0"
}
],
"component" : {
"name" : "JustATestClassLibrary",
"version" : "1.0.0",
"type" : "library",
"bom-ref" : "9bcfcc86-768a-406f-ba84-55ee28d9a983"
}
},
"components" : [
{
"name" : "Newtonsoft.Json",
"version" : "4.0.1",
"description" : "Json.NET is a popular high-performance JSON framework for .NET",
"hashes" : [
{
"alg" : "SHA-512",
"content" : "c7a076a8455f603c1f216ae85ad4baf7647c5592d0783bb7d1ef93adca03e795aefb497245255be15586e84258b268d97e2a8cfcc33732b454c193d0eb002027"
}
],
"purl" : "pkg:nuget/Newtonsoft.Json@4.0.1",
"externalReferences" : [
{
"type" : "website",
"url" : "http://james.newtonking.com/projects/json-net.aspx"
}
],
"type" : "library",
"bom-ref" : "71b170f5-40e4-48d3-ae3c-93ad455043bd"
}
]
}
```

==> please clarify.

### Steps to Reproduce

See above.

### Expected Behavior

Data is taken over from BOM.

### Dependency-Track Version

4.7.0

### Dependency-Track Distribution

Container Image

### Database Server

N/A

### Database Server Version

_No response_

### Browser

Google Chrome

### Checklist

- [X] I have read and understand the [contributing guidelines](https://github.com/DependencyTrack/dependency-track/blob/master/CONTRIBUTING.md#filing-issues)
- [X] I have checked the [existing issues](https://github.com/DependencyTrack/dependency-track/issues) for whether this defect was already reported

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.