Skip to content

Add Apache Log4j security advisories importer - #2213

Open
xovishnukosuri wants to merge 2 commits into
aboutcode-org:mainfrom
xovishnukosuri:add-apache-log4j-importer
Open

xovishnukosuri wants to merge 2 commits into
aboutcode-org:mainfrom
xovishnukosuri:add-apache-log4j-importer

Conversation

@xovishnukosuri

Copy link
Copy Markdown

Fixes #586

What this does

Adds a V2 pipeline importer (ApacheLog4jImporterPipeline) for Apache Log4j security advisories from the authoritative CycloneDX Vulnerability Disclosure Report (VDR) at https://logging.apache.org/cyclonedx/vdr.xml.

This was pointed out in the issue comments: the VDR file is the machine-readable source maintained by the Apache Logging team. It covers all Log4j subprojects (log4j-core, log4cxx, etc.) and is updated as new CVEs are disclosed.

How it works

  1. Fetches the CycloneDX VDR XML (namespace http://cyclonedx.org/schema/bom/1.6)
  2. Parses each <vulnerability> element for: CVE ID, description, published date, CVSS ratings (v3/v3.1/v4), CWE IDs, VERS-format version ranges, and references
  3. VERS ranges (e.g. vers:maven/>=2.0-beta9|<2.15.0) are parsed directly via univers.VersionRange.from_string
  4. PURLs come from the <ref> element verbatim (e.g. pkg:maven/org.apache.logging.log4j/log4j-core?type=jar)
  5. Multiple version ranges per advisory each become a separate AffectedPackageV2
  6. Yields AdvisoryDataV2 objects with CVE alias, summary, CVSS severity, affected version ranges, weaknesses, and references

Data source notes

Tests

Added test_apache_log4j_importer_v2.py with 20 tests covering:

  • parse_date (valid, empty, invalid)
  • parse_weaknesses (multiple CWEs, none, non-numeric ignored)
  • parse_severities (CVSSv3, CVSSv4, unknown method skipped, no ratings)
  • parse_affected_packages (single range, multiple ranges, no affects)
  • parse_references (NVD only, with issue tracker)
  • parse_advisory (full CVE-2021-44228, no ID returns None)
  • collect_advisories and advisories_count (mocked HTTP)

All 20 tests pass. Pipeline ID uniqueness test also passes.

Checklist

  • Signed-off-by in commit
  • Follows V2 importer pipeline pattern
  • Registered in IMPORTERS_REGISTRY in vulnerabilities/importers/__init__.py
  • Uses the machine-readable VDR source (not HTML scraping)
  • Tests written and passing locally

Vishnu Kosuri and others added 2 commits March 14, 2026 11:54
Implements a V2 pipeline importer for Liferay Portal and DXP security
advisories published at liferay.dev. Collects data from the Atom RSS
feed, then fetches each individual advisory page to extract CVE ID,
CVSS score and vector, affected and fixed version lists, and publication
date. Registers LiferayImporterPipeline in the importers registry.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Reads the CycloneDX VDR XML file at https://logging.apache.org/cyclonedx/vdr.xml,
which is the authoritative machine-readable source for Log4j security advisories.

Each <vulnerability> element contains a CVE ID, CVSS ratings (v3/v4), CWE IDs,
description, published date, and VERS-format version ranges per affected artifact
(currently log4j-core maven coordinates). VERS ranges are parsed directly via
univers VersionRange.from_string; PURLs come from the <ref> element verbatim.

Adds ApacheLog4jImporterPipeline registered in IMPORTERS_REGISTRY.
Adds 20 unit tests covering all parsing helpers and mocked HTTP calls.

Signed-off-by: Vishnu Kosuri <xovishnukosuri@gmail.com>

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Track Apache Log4j advisories

1 participant