You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
get_or_create_advisory_aliases (vulnerabilities/pipes/advisory.py) bulk-creates every alias with no length check, but AdvisoryAlias.alias is CharField(max_length=50). An alias over 50 chars raises django.db.utils.DataError: value too long for type character varying(50) inside insert_advisory_v2, which has no try/except around the alias step — the base pipeline catches it per-advisory and logs "Failed to import advisory", so the whole advisory is silently dropped from the import.
Evidence
Scanned the OSV bulk exports for 8 ecosystems (62,291 advisories: Hex, NuGet, crates.io, RubyGems, Maven, Go, Packagist, PyPI). 12 records carry an alias over 50 chars — 6 distinct SNYK-Golang ids (SNYK ids embed the full uppercase module path, so the class is open-ended, not just these 6):
51 chars: SNYK-GOLANG-GITHUBCOMNATSIONATSSERVERSERVER-1042967 (GO-2022-0855 / GHSA-m4jx-6526-vvhm) and SNYK-GOLANG-GITHUBCOMMHOLTARCHIVERCMDARCHIVER-50071 (GHSA-5wmg-j84w-4jj4)
Reproduced on current main: a minimal AdvisoryDataV2 carrying the real GHSA-599h-8wpj-75xj aliases passed to insert_advisory_v2 raises the DataError above.
Fix (see linked PR)
Skip over-long aliases with an error log in get_or_create_advisory_aliases. A truncated alias would be a false identifier, so skipping keeps stored data truthful and lets the advisory import with its other aliases. Widening the column was considered and not taken: it would fix the 6 known ids, but a longer SNYK id re-breaks it; the skip closes the class at any length.
The same advisory also flows through the github_osv importer (same parse_advisory_data_v3 path), so one fix covers both.
Caveat
The skipped SNYK alias is genuinely lost from the record (the advisory keeps its CVE + GO aliases). If maintainers prefer a migration widening the column instead, happy to rework.
Activity