Some CycloneDX SBOM files v.1.6 generated by trivy image are not compliant with cyclonedx validator #8615
DescriptionI found that the CycloneDX-JSON SBOM files generated from playwright docker image by Trivy are not compliant with the official CycloneDX schema. I ran into this issue while working with license information and external tools like Dependency-Track that rely on schema compliance. It appears to be quite the same issue as reported here: #4900 Desired Behaviortrivy produces SBOM file compliant with CycloneDX-JSON schema Actual Behaviortrivy generates invalid SBOM JSON file. Validation command: Validation output:Validating JSON BOM...
Validation failed:
Expected 1 matching subschema but found 0
http://cyclonedx.org/schema/bom-1.6.schema.json#/definitions/licenseChoice
On instance: /components/52/licenses:
[
{
"license": {
"name": "LGPL-2.0-or-later"
}
},
{
"license": {
"name": "MIT/X11"
}
},
{
"license": {
"name": "UNKNOWN"
}
},
{
"license": {
"name": "GPL-2.0-or-later"
}
},
{
"license": {
"name": "MPL-1.1 LGPL-2+"
}
},
{
"license": {
"name": "MPL-1.1"
}
},
{
"license": {
"name": "LGPL-2.1-or-later"
}
},
{
"license": {
"name": "MPL-1.1 GPL GPL-2+ LGPL"
}
},
{
"license": {
"name": "BSD-3-Clause"
}
},
{
"license": {
"name": "GPL-3.0-or-later"
}
},
{
"license": {
"name": "LGPL-2.1-only"
}
},
{
"license": {}
},
{
"license": {
"name": "MPL-1.1 GPL"
}
}
]
Expected 1 matching subschema but found 0
http://cyclonedx.org/schema/bom-1.6.schema.json#/definitions/licenseChoice
On instance: /components/199/licenses:
[
{
"license": {
"name": "LGPL-2.0-or-later"
}
},
{
"license": {
"name": "MIT/X11"
}
},
{
"license": {
"name": "UNKNOWN"
}
},
{
"license": {
"name": "GPL-2.0-or-later"
}
},
{
"license": {
"name": "MPL-1.1 LGPL-2+"
}
},
{
"license": {
"name": "MPL-1.1"
}
},
{
"license": {
"name": "LGPL-2.1-or-later"
}
},
{
"license": {
"name": "MPL-1.1 GPL GPL-2+ LGPL"
}
},
{
"license": {
"name": "BSD-3-Clause"
}
},
{
"license": {
"name": "GPL-3.0-or-later"
}
},
{
"license": {
"name": "LGPL-2.1-only"
}
},
{
"license": {}
},
{
"license": {
"name": "MPL-1.1 GPL"
}
}
]
Value should have at most 1 items
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1
On instance: /components/52/licenses:
[
{
"license": {
"name": "LGPL-2.0-or-later"
}
},
{
"license": {
"name": "MIT/X11"
}
},
{
"license": {
"name": "UNKNOWN"
}
},
{
"license": {
"name": "GPL-2.0-or-later"
}
},
{
"license": {
"name": "MPL-1.1 LGPL-2+"
}
},
{
"license": {
"name": "MPL-1.1"
}
},
{
"license": {
"name": "LGPL-2.1-or-later"
}
},
{
"license": {
"name": "MPL-1.1 GPL GPL-2+ LGPL"
}
},
{
"license": {
"name": "BSD-3-Clause"
}
},
{
"license": {
"name": "GPL-3.0-or-later"
}
},
{
"license": {
"name": "LGPL-2.1-only"
}
},
{
"license": {}
},
{
"license": {
"name": "MPL-1.1 GPL"
}
}
]
Value should have at most 1 items
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1
On instance: /components/199/licenses:
[
{
"license": {
"name": "LGPL-2.0-or-later"
}
},
{
"license": {
"name": "MIT/X11"
}
},
{
"license": {
"name": "UNKNOWN"
}
},
{
"license": {
"name": "GPL-2.0-or-later"
}
},
{
"license": {
"name": "MPL-1.1 LGPL-2+"
}
},
{
"license": {
"name": "MPL-1.1"
}
},
{
"license": {
"name": "LGPL-2.1-or-later"
}
},
{
"license": {
"name": "MPL-1.1 GPL GPL-2+ LGPL"
}
},
{
"license": {
"name": "BSD-3-Clause"
}
},
{
"license": {
"name": "GPL-3.0-or-later"
}
},
{
"license": {
"name": "LGPL-2.1-only"
}
},
{
"license": {}
},
{
"license": {
"name": "MPL-1.1 GPL"
}
}
]
Required properties ["expression"] are not present
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/items/0
On instance: /components/52/licenses/0:
{
"license": {
"name": "LGPL-2.0-or-later"
}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/52/licenses/1:
{
"license": {
"name": "MIT/X11"
}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/52/licenses/2:
{
"license": {
"name": "UNKNOWN"
}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/52/licenses/3:
{
"license": {
"name": "GPL-2.0-or-later"
}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/52/licenses/4:
{
"license": {
"name": "MPL-1.1 LGPL-2+"
}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/52/licenses/5:
{
"license": {
"name": "MPL-1.1"
}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/52/licenses/6:
{
"license": {
"name": "LGPL-2.1-or-later"
}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/52/licenses/7:
{
"license": {
"name": "MPL-1.1 GPL GPL-2+ LGPL"
}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/52/licenses/8:
{
"license": {
"name": "BSD-3-Clause"
}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/52/licenses/9:
{
"license": {
"name": "GPL-3.0-or-later"
}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/52/licenses/10:
{
"license": {
"name": "LGPL-2.1-only"
}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/52/licenses/11:
{
"license": {}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/52/licenses/12:
{
"license": {
"name": "MPL-1.1 GPL"
}
}
Required properties ["expression"] are not present
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/items/0
On instance: /components/199/licenses/0:
{
"license": {
"name": "LGPL-2.0-or-later"
}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/199/licenses/1:
{
"license": {
"name": "MIT/X11"
}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/199/licenses/2:
{
"license": {
"name": "UNKNOWN"
}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/199/licenses/3:
{
"license": {
"name": "GPL-2.0-or-later"
}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/199/licenses/4:
{
"license": {
"name": "MPL-1.1 LGPL-2+"
}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/199/licenses/5:
{
"license": {
"name": "MPL-1.1"
}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/199/licenses/6:
{
"license": {
"name": "LGPL-2.1-or-later"
}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/199/licenses/7:
{
"license": {
"name": "MPL-1.1 GPL GPL-2+ LGPL"
}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/199/licenses/8:
{
"license": {
"name": "BSD-3-Clause"
}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/199/licenses/9:
{
"license": {
"name": "GPL-3.0-or-later"
}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/199/licenses/10:
{
"license": {
"name": "LGPL-2.1-only"
}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/199/licenses/11:
{
"license": {}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/additionalItems
On instance: /components/199/licenses/12:
{
"license": {
"name": "MPL-1.1 GPL"
}
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/items/0/additionalProperties
On instance: /components/52/licenses/0/license:
{
"name": "LGPL-2.0-or-later"
}
All values fail against the false schema
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1/items/0/additionalProperties
On instance: /components/199/licenses/0/license:
{
"name": "LGPL-2.0-or-later"
}
Expected 1 matching subschema but found 0
http://cyclonedx.org/schema/bom-1.6.schema.json#/definitions/license
On instance: /components/52/licenses/11/license:
{}
Expected 1 matching subschema but found 0
http://cyclonedx.org/schema/bom-1.6.schema.json#/definitions/license
On instance: /components/199/licenses/11/license:
{}
Required properties ["id"] are not present
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/0
On instance: /components/52/licenses/11/license:
{}
Required properties ["name"] are not present
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1
On instance: /components/52/licenses/11/license:
{}
Required properties ["id"] are not present
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/0
On instance: /components/199/licenses/11/license:
{}
Required properties ["name"] are not present
http://cyclonedx.org/schema/bom-1.6.schema.json#/oneOf/1
On instance: /components/199/licenses/11/license:
{}
BOM is not valid.Reproduction Steps1. trivy image --format cyclonedx -d mcr.microsoft.com/playwright:v1.50.0-noble > playwright-sbom.json
2. cyclonedx validate --input-format json --fail-on-errors --input-version v1_6 --input-file playwright-sbom.json
* Lot's of validation errors related to licenses - see "Actual Behavior - Validation output" above
BOM is not valid.TargetContainer Image ScannerNone Output FormatCycloneDX ModeStandalone Debug Output$trivy image --format cyclonedx -d mcr.microsoft.com/playwright:v1.50.0-noble > playwright-sbom.json
2025-03-26T19:24:38+02:00 DEBUG No plugins loaded
2025-03-26T19:24:38+02:00 DEBUG Default config file "file_path=trivy.yaml" not found, using built in values
2025-03-26T19:24:38+02:00 DEBUG Cache dir dir="/Users/foo/Library/Caches/trivy"
2025-03-26T19:24:38+02:00 DEBUG Cache dir dir="/Users/foo/Library/Caches/trivy"
2025-03-26T19:24:38+02:00 DEBUG Parsed severities severities=[UNKNOWN LOW MEDIUM HIGH CRITICAL]
2025-03-26T19:24:38+02:00 DEBUG Ignore statuses statuses=[]
2025-03-26T19:24:38+02:00 INFO "--format cyclonedx" disables security scanning. Specify "--scanners vuln" explicitly if you want to include vulnerabilities in the "cyclonedx" report.
2025-03-26T19:24:38+02:00 DEBUG [pkg] Package types types=[os library]
2025-03-26T19:24:38+02:00 DEBUG [pkg] Package relationships relationships=[unknown root workspace direct indirect]
2025-03-26T19:24:38+02:00 DEBUG Initializing scan cache... type="fs"
2025-03-26T19:24:38+02:00 DEBUG [image] Detected image ID image_id="sha256:37646a0961bdc9dc96c1d7009b745047270a91be232d9ec825fa04b36a023af0"
2025-03-26T19:24:38+02:00 DEBUG [image] Detected diff ID diff_ids=[sha256:687d50f2f6a697da02e05f2b2b9cb05c1d551f37c404ebe55fdec44b0ae8aa5c sha256:80e1c3911303c7acec9112ee69a6f990c4fac699d0a9c9a65ffe1b07290682f1 sha256:17898b60bd647ac2fb9df2cb91c9c18296feed67303f22bf6521ad96a9d1ca31 sha256:dc162da5a01585eaf6d25d545dbd6be2cbb2b9ba1f90d795b387ac8e0f7acedc]
2025-03-26T19:24:38+02:00 DEBUG [image] Detected base layers diff_ids=[sha256:687d50f2f6a697da02e05f2b2b9cb05c1d551f37c404ebe55fdec44b0ae8aa5c]
2025-03-26T19:24:38+02:00 INFO Detected OS family="ubuntu" version="24.04"
2025-03-26T19:24:38+02:00 INFO Number of language-specific files num=1
2025-03-26T19:24:38+02:00 DEBUG Specified ignore file does not exist file=".trivyignore"
2025-03-26T19:24:38+02:00 DEBUG [vex] VEX filtering is disabledOperating Systemmacos sequoia 15.3 Version$ trivy --version
Version: 0.60.0
$ cyclonedx --version
0.27.2+f934c99826339cb8dbb83b439eb2c465fb253fb3Checklist
|
Replies: 3 comments 2 replies
|
Hello @AksuX
If you have more details about problem - let me know. Regards, Dmitriy |
Created #8621