Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit 9763dd6

Browse files
committed
Fixed github advisories source
1 parent 9eeee17 commit 9763dd6

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ python3 cveseeker.py cve-2024 --critical --high --medium --low # include critica
3131
- [www.cisa.gov - KEV](https://www.cisa.gov/known-exploited-vulnerabilities-catalog) (IMPLEMENTED)
3232
- [www.rapid7.com](https://www.rapid7.com) (WIP)
3333
- [cve.mitre.org](https://cve.mitre.org/cve/search_cve_list.html) (WIP)
34-
- [github.com](https://github.com) (WIP)
3534
- [github.com PoC](https://github.com/nomi-sec/PoC-in-GitHub) (IMPLEMENTED)
3635
- [github.com advisories](https://github.com/advisories) (IMPLEMENTED)
3736
- [github.com/trickest/cve](https://github.com/search?q=repo%3Atrickest%2Fcve%20cve-2024&type=code) (IMPLEMENTED)

services/api/sources/github_advisories.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def search(self, keywords: List[str], max_results) -> List[Vulnerability]:
6363
break
6464

6565
self.session.close()
66+
6667
return vulnerabilities
6768

6869
def process_advisory_element(self, element):
@@ -72,15 +73,16 @@ def process_advisory_element(self, element):
7273
return None
7374
title = title_tag.text.strip()
7475
advisory_href = title_tag['href']
76+
7577
advisory_url = f"https://github.com{advisory_href}"
7678
advisory_id = advisory_href.strip('/').split('/')[-1]
7779

7880
severity_span = element.find('span', class_='Label')
7981
base_severity = severity_span.text.strip() if severity_span else DEFAULT_VALUES['base_severity']
80-
82+
8183
cve_span = element.find('span', class_='text-bold')
8284
cve_id = cve_span.text.strip() if cve_span else None
83-
85+
8486
mt1_div = element.find('div', class_='mt-1')
8587
package_name = None
8688
if mt1_div:
@@ -138,21 +140,14 @@ def process_advisory_element(self, element):
138140
vulnerability_id = cve_id if cve_id and cve_id != DEFAULT_VALUES['id'] else advisory_id
139141

140142
cvss_score = DEFAULT_VALUES['base_score']
141-
cvss_metrics = {}
143+
142144
severity_section = advisory_soup.find('h3', text='Severity')
143145
if severity_section:
144146
severity_container = severity_section.find_next('div')
145147
if severity_container:
146148
score_span = severity_container.find('span', class_='Button-label')
147149
if score_span:
148150
cvss_score = score_span.text.strip()
149-
metrics_div = severity_container.find('div', class_='d-flex flex-column mt-2 p-2 border rounded-2')
150-
if metrics_div:
151-
metric_items = metrics_div.find_all('div', class_='d-flex p-1 flex-justify-between')
152-
for item in metric_items:
153-
metric_name = item.contents[0].strip()
154-
metric_value = item.find('div').text.strip()
155-
cvss_metrics[metric_name] = metric_value
156151

157152
weaknesses = []
158153
weaknesses_section = advisory_soup.find('h3', text='Weaknesses')
@@ -177,9 +172,9 @@ def process_advisory_element(self, element):
177172
base_severity=base_severity,
178173
description=description,
179174
vulnerable_components=vulnerable_components,
180-
cvss_metrics=cvss_metrics,
181175
weaknesses=weaknesses,
182176
)
177+
183178
return vulnerability
184179

185180
except Exception as e:

services/vulnerability_intelligence/enrichment/enrichment/github_poc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import httpx
22
import logging
33
from typing import Dict
4+
from dateutil import parser as dateutil_parser
45

56
def fetch_github_poc_data(cve: str) -> Dict:
67
year = cve.split('-')[1]
@@ -26,7 +27,7 @@ def fetch_github_poc_data(cve: str) -> Dict:
2627

2728
data['github_url'] = entry["html_url"]
2829
data['github_description'] = entry["description"]
29-
data['github_date'] = entry["updated_at"]
30+
data['github_date'] = dateutil_parser.parse(entry["created_at"]).strftime('%Y-%m-%d')
3031
data['github_tags'].extend(entry["topics"])
3132
data['github_stars'] = entry["stargazers_count"]
3233

0 commit comments

Comments
 (0)