CycloneDX reports ingested as array instead of hash cause specVersion lookup to throw exception
Summary
We have received an exception caused by a type mismatch. These errors are not shown to users and are not caught by the rescue because they are not of the expected type.
Steps to reproduce
- Create a valid CycloneDX report using the Dependency Scanning analyzer.
- Enclose it in a JSON array using
[]. - Upload that report as a
cyclonedxreport using a CI/CD pipeline configuration. - Verify that the Security tab is empty with no error.
Example Project
N/A
What is the current bug behavior?
An exception is thrown, and a failure happens silently on ingestion.
What is the expected correct behavior?
We should catch the exception for the type mismatch, and then show it to users who can then adjust/fix their uploaded report format.
Relevant logs and/or screenshots
Related to GITLABCOM-ASZR.
Possible fixes
- Catch the
TypeErrorexception, and show it as an error.
Edited by Oscar Tovar