add null guards to intel collection to catch mismatched ecosystem early#307
add null guards to intel collection to catch mismatched ecosystem early#307etsien wants to merge 2 commits into
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
The main thing to check is if this affects the Client in any unintended way. |
|
@etsien
Did you test on file output mode in the configuration? ( to get analysis result as file?) |
|
yes, this only addresses file output mode. I will test with other output modes. |
|
found another area to address, the |

If for whatever reason a submitted CVE doesn't match the language/ecosystem of the target package, we handle it gracefully instead of a misleading HTTP 500 internal server error.
Summary
Add null guards in
_add_cve_inteland_add_referencesto preventTypeErrorcrashes whenclone_and_depsfails andinfo.intelis never populated.Problem
When
clone_and_depsfails (e.g., due to ecosystem/manifest mismatches), the pipeline skipsfetch_intel, leavingmodel_dict.info.intel = None. The report generation step inoutput_formatter.pythen attempts to iterate over thisNonevalue, resulting in an unhandledTypeError: 'NoneType' object is not iterablethat surfaces as an HTTP 500 to the caller.Root Cause
_add_cve_intel(line 136) and_add_references(line 510) both executefor intel_obj in model_dict.info.intelwithout checking whetherinfo.intelisNone. The pipeline's failure path forclone_and_depsdoes not guarantee thatinfo.intelis populated before reaching the formatter.Fix
Added early-return null guards at the top of both
_add_cve_inteland_add_references:When intel data is unavailable, the report is still generated but omits the intel summary and references sections rather than crashing.
Testing
Attached below is sample output of a ecosystem-mismatched CVE. Previously it would crash the pipeline with HTTP 500 error.
ad2aa354-ee25-4448-8cf6-87b64529576e_CVE-2025-28162_1.json