Merge pull request #621 from cudeso/main

Small bug fix for vulners - vulners_ai_score
pull/627/head
Alexandre Dulaunoy 2023-07-04 16:26:51 +02:00 committed by GitHub
commit d23f116e7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -34,7 +34,9 @@ def handler(q=False):
if 'score' in vulners_document.get('enchantments', {}):
vulners_ai_score = vulners_document['enchantments']['score']['value']
else:
vulners_ai_score = None
vulners_ai_score = vulners_api.get_ai_score(vulnerability)
if len(vulners_ai_score) == 2:
vulners_ai_score = vulners_ai_score[0]
vulners_exploits = vulners_api.searchExploit(vulnerability)
@ -44,7 +46,7 @@ def handler(q=False):
vuln_summary += 'Non existing CVE'
if vulners_ai_score:
ai_summary += 'Vulners AI Score is ' + str(vulners_ai_score[0]) + " "
ai_summary += 'Vulners AI Score is ' + str(vulners_ai_score) + " "
if vulners_exploits:
exploit_summary += " || " + str(len(vulners_exploits)) + " Public exploits available:\n "