fix(search_vulns): cvss score not pulled properly (#1082)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Fixed CVSS score retrieval for vulnerability data to extract values
from the correct data structure, with automatic fallback to default
values when data is missing. This ensures consistent and accurate
severity reporting across all vulnerability searches.

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/freelabz/secator/pull/1082)

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Olivier Cervello 2026-05-12 10:18:02 +02:00 committed by GitHub
parent 029516195f
commit 9d2ccf5546
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -100,7 +100,7 @@ class search_vulns(Vuln):
confidence = 'high'
tags = search_vulns.extract_tags(vuln_data)
exploits = vuln_data.get('exploits', [])
cvss_score = float(vuln_data.get('cvss', 0))
cvss_score = float(vuln_data.get('severity', {}).get('CVSS', {}).get('score', 0))
extra_data = search_vulns.extract_extra_data(vuln_data)
extra_data['service_name'] = self.inputs[0] if self.inputs else ''
references = search_vulns.extract_references(vuln_data)