Skip to content

Path traversal via unvalidated cveId in gen-advisory (arbitrary file write) #1

Description

@MarkAtwood

Summary

central/gen-advisory writes advisory/VEX output to a path built from the record's cveId, which is taken verbatim from record content (records are fetched from the remote MITRE API, cveawg.mitre.org) and never validated. This is an untrusted-input → arbitrary-file-write boundary.

Location

central/gen-advisory:912-915 (also 909-910, 258)

Confirmed

A record with cveId: "../ESCAPED" and --out-dir out/batch wrote out/ESCAPED.csaf.json / out/ESCAPED.cdx.json outside the intended directory.

Fix

In parse_record, reject any cve_id not matching ^CVE-[0-9]{4}-[0-9]{4,}$ before it is used to build a filename. Apply the same validation to --advisory-id.

Severity

High — arbitrary file write from remotely-sourced input.

Found in an internal review (2026-07-23). Tracked internally as SBOM-gpex.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions