Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add ZDI security advisory importer#2201

Open
NucleiAv wants to merge 6 commits into
aboutcode-org:main from
NucleiAv:fix/zdi-importer-1471
Open

Add ZDI security advisory importer #2201
NucleiAv wants to merge 6 commits into
aboutcode-org:main from
NucleiAv:fix/zdi-importer-1471

Conversation

@NucleiAv

@NucleiAv NucleiAv commented Mar 8, 2026
edited
Loading

Copy link
Copy Markdown

Closes #1471

Collects ZDI security advisories from the public RSS feeds at zerodayinitiative.com/rss/published/YEAR/, one feed per year from 2007 to the current year. Each advisory gets its ZDI ID from the link URL, CVE aliases from the description text, publish date, and a reference URL. The RSS feed has no structured package or version data, so affected_packages is empty. New files are zdi_importer.py, test_zdi_importer.py (7 tests), zdi_rss_mock.xml, and expected_zdi_advisory_output1.json.

NucleiAv and others added 2 commits March 8, 2026 03:02
Implements ZDI importer pipeline (issue 1471) using the Zero Day
Initiative RSS feeds at zerodayinitiative.com/rss/published/YEAR/.
Fetches year-specific feeds from 2007 through the current year,
parses advisory ID from the link URL, extracts CVE aliases from the
description, and records the publication date. Deduplicates advisories
across feeds using a seen-IDs set.
Includes 7 unit tests covering normal parsing, missing CVE, missing
link, invalid XML, and alias deduplication.
Signed-off-by: newklei <magmacicada@proton.me>
Signed-off-by: newklei <magmacicada@proton.me>

@ziadhany ziadhany left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NucleiAv , This is a good start. Please see the comments there.

pipeline_id = "zdi_importer"
spdx_license_expression = "LicenseRef-scancode-proprietary-license"
license_url = "https://www.zerodayinitiative.com"
repo_url = "https://www.zerodayinitiative.com"

@ziadhany ziadhany Mar 8, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think we need this.

Suggested change
repo_url = "https://www.zerodayinitiative.com"

item = {
"title": "ZDI-25-100: Some Vulnerability",
"link": "http://www.zerodayinitiative.com/advisories/ZDI-25-100/",
"description": "CVSS 7.0. CVE-2025-11111.",

@ziadhany ziadhany Mar 8, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are missing CVSS parsing. See:
https://www.zerodayinitiative.com/advisories/published/2025/

Also, have a look at the other importers to see how we can store the CVSS score.

ZDI_RSS_YEAR_URL.format(year=year) for year in range(ZDI_START_YEAR, current_year + 1)
]

seen_ids = set()

@ziadhany ziadhany Mar 8, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we have a seed ids ?

try:
date_published = datetime.strptime(pub_date_str, PUBDATE_FORMAT)
except ValueError:
logger.warning("Could not parse date %r for advisory %s", pub_date_str, advisory_id)

@ziadhany ziadhany Mar 8, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there might be a better way to do this. You could use the dateparser library. See the other importers for how we handle this parsing

>> import dateparser
>> dateparser.parse("Tue, 07 Jan 2025 00:00:00 -0600")
>> datetime.datetime(2025, 1, 7, 0, 0, tzinfo=<StaticTzInfo 'UTC-06:00'>)

ZDI_START_YEAR = 2007
ZDI_ID_RE = re.compile(r"ZDI-\d+-\d+")
CVE_RE = re.compile(r"CVE-\d{4}-\d{4,7}")
PUBDATE_FORMAT = "%a, %d %b %Y %H:%M:%S %z"

@ziadhany ziadhany Mar 8, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PUBDATE_FORMAT = "%a, %d %b %Y %H:%M:%S %z"

ZDI_RSS_YEAR_URL = "https://www.zerodayinitiative.com/rss/published/{year}/"
ZDI_START_YEAR = 2007
ZDI_ID_RE = re.compile(r"ZDI-\d+-\d+")
CVE_RE = re.compile(r"CVE-\d{4}-\d{4,7}")

@ziadhany ziadhany Mar 8, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have a function for this
see utils.py file.

@NucleiAv NucleiAv Mar 8, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ziadhany
Fixed all points:
Removed repo_url
Removed seen_ids: agreed, the pipeline framework handles deduplication at the DB level
Replaced strptime + PUBDATE_FORMAT with dateparser.parse()
Switched to find_all_cve from utils.py
Added CVSS score parsing via CVSS_RE = re.compile(r"CVSS rating of (\d+\.?\d*)") - the RSS description contains e.g. "The ZDI has assigned a CVSS rating of 8.8." so this extracts the score and stores it as a VulnerabilitySeverity with GENERIC system

Also fixed two CI failures that showed up:
Black - zdi_importer.py and test_zdi_importer.py were not formatted to --line-length 100
isort - __init__.py had the zdi_importer import inserted out of alphabetical order (between gitlab and istio instead of after xen)

NucleiAv added 2 commits March 8, 2026 15:40
Signed-off-by: newklei <magmacicada@proton.me>
- Remove repo_url field (not needed by base class)
- Remove seen_ids deduplication set
- Replace strptime/PUBDATE_FORMAT with dateparser.parse()
- Use find_all_cve from utils.py instead of local CVE_RE
- Add CVSS score parsing from RSS description field
- Update expected test fixture to include CVSS severity
Signed-off-by: newklei <magmacicada@proton.me>

NucleiAv commented Mar 8, 2026

Copy link
Copy Markdown
Author

@ziadhany the workflows have succeeded... it is good to go
Let me know if anything else is needed!

Signed-off-by: newklei <magmacicada@proton.me>
@NucleiAv NucleiAv deleted the fix/zdi-importer-1471 branch March 16, 2026 13:35
@NucleiAv NucleiAv restored the fix/zdi-importer-1471 branch March 16, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ziadhany ziadhany Awaiting requested review from ziadhany

Requested changes must be addressed to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Collect data from https://www.zerodayinitiative.com/advisories/

AltStyle によって変換されたページ (->オリジナル) /