fix: widen reference URL column to handle long Mozilla CVE URLs#8467
fix: widen reference URL column to handle long Mozilla CVE URLs#8467steffenjacobs wants to merge 9 commits intodependency-check:mainfrom
Conversation
Some Mozilla CVE references (e.g. CVE-2026-6785 at 1585 chars, CVE-2026-6786 at 1115 chars) contain bugzilla URLs with many concatenated bug IDs that exceed the existing VARCHAR(1000) limit on the reference.url column, causing NvdApiProcessor to fail processing the affected CVEs. Widen the reference.url column from VARCHAR(1000) to VARCHAR(4000) across all dialect schemas (H2, MSSQL, MySQL, Oracle, PostgreSQL), add upgrade_5.5.sql so existing H2 databases auto-migrate, and bump the schema version from 5.5 to 5.6. Fixes dependency-check#8466
marcelstoer
left a comment
There was a problem hiding this comment.
It's unfortunate that we have to do this but it LGTM.
|
|
@OrangeDog That is a very valid concern, but so is the author's judgement
Which one is the lesser evil? |
Co-authored-by: Jeremy Long <jeremy.long@gmail.com>
Co-authored-by: Jeremy Long <jeremy.long@gmail.com>
Co-authored-by: Jeremy Long <jeremy.long@gmail.com>
Co-authored-by: Jeremy Long <jeremy.long@gmail.com>
Co-authored-by: Jeremy Long <jeremy.long@gmail.com>
Co-authored-by: Jeremy Long <jeremy.long@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the embedded Dependency-Check DB schema to support very long CVE reference URLs (notably Mozilla Bugzilla links) by widening the reference.url column and bumping the expected schema version so the H2 database can auto-upgrade.
Changes:
- Bumps the expected DB schema version from
5.5to5.6in runtime and testdependencycheck.properties. - Widens the
reference.urlcolumn in all dialect initialization SQL scripts. - Adds an H2 auto-migration script
upgrade_5.5.sqlto alter the column and update the schema version inproperties.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| core/src/main/resources/dependencycheck.properties | Bumps expected schema version to 5.6 |
| core/src/test/resources/dependencycheck.properties | Bumps expected schema version to 5.6 for tests |
| core/src/main/resources/data/upgrade_5.5.sql | Adds H2 upgrade from 5.5 → 5.6 and alters reference.url |
| core/src/main/resources/data/initialize.sql | Widens reference.url and updates schema version in properties |
| core/src/main/resources/data/initialize_postgres.sql | Widens reference.url and updates schema version in properties |
| core/src/main/resources/data/initialize_oracle.sql | Widens reference.url and updates schema version in properties |
| core/src/main/resources/data/initialize_mysql.sql | Widens reference.url and updates schema version in properties |
| core/src/main/resources/data/initialize_mssql.sql | Widens reference.url and updates schema version in properties |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Oracle's standard VARCHAR2 max is 4000 bytes (without enabling MAX_STRING_SIZE=EXTENDED), so revert just the Oracle init script to VARCHAR(4000) while the other dialects stay at VARCHAR(8000).
|
I will try and release this over the weekend. |
Some Mozilla CVE references (e.g. CVE-2026-6785 at 1585 chars, CVE-2026-6786 at 1115 chars) contain bugzilla URLs with many concatenated bug IDs that exceed the existing
VARCHAR(1000)limit onreference.url, causingNvdApiProcessorto throwDatabaseException: Value too long for column "URL CHARACTER VARYING(1000)"and skip those CVEs.This widens the
reference.urlcolumn fromVARCHAR(1000)toVARCHAR(4000)(4000 was chosen to stay within Oracle's standardVARCHAR2(4000)limit and avoid falling back toTEXT/CLOB on any supported dialect):
initialize.sql,initialize_mssql.sql,initialize_mysql.sql,initialize_oracle.sql,initialize_postgres.sql).upgrade_5.5.sqlso existing H2 databases auto-migrate viaDatabaseManager.updateSchema().5.5to5.6independencycheck.propertiesand the property version inside each init script.Verified locally against the test
data.zip(a real 5.5 H2 db atsrc/test/resources/data.zip): the upgrade runs without errors, all 158,933 existing reference rows are preserved,and a 1848-char Mozilla bugzilla URL inserts successfully where it previously failed.
Related issues
Have test cases been added to cover the new functionality?
no - existing
DatabaseManagerTest.testInitializeand any test extendingBaseDBTestCasealready exerciseupgrade_5.5.sqlbecause the bundleddata.zipis at schema 5.5 and theapplication now expects 5.6.