Skip to content

fix: widen reference URL column to handle long Mozilla CVE URLs#8467

Open
steffenjacobs wants to merge 9 commits intodependency-check:mainfrom
steffenjacobs:fix/widen-reference-url-column
Open

fix: widen reference URL column to handle long Mozilla CVE URLs#8467
steffenjacobs wants to merge 9 commits intodependency-check:mainfrom
steffenjacobs:fix/widen-reference-url-column

Conversation

@steffenjacobs
Copy link
Copy Markdown

@steffenjacobs steffenjacobs commented Apr 29, 2026

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 reference.url, causing NvdApiProcessor to throw DatabaseException: Value too long for column "URL CHARACTER VARYING(1000)" and skip those CVEs.

This widens the reference.url column from VARCHAR(1000) to VARCHAR(4000) (4000 was chosen to stay within Oracle's standard VARCHAR2(4000) limit and avoid falling back to
TEXT/CLOB on any supported dialect):

  • Updated all 5 dialect initialization scripts (initialize.sql, initialize_mssql.sql, initialize_mysql.sql, initialize_oracle.sql, initialize_postgres.sql).
  • Added upgrade_5.5.sql so existing H2 databases auto-migrate via DatabaseManager.updateSchema().
  • Bumped the schema version from 5.5 to 5.6 in dependencycheck.properties and the property version inside each init script.

Verified locally against the test data.zip (a real 5.5 H2 db at src/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.testInitialize and any test extending BaseDBTestCase already exercise upgrade_5.5.sql because the bundled data.zip is at schema 5.5 and the
application now expects 5.6.

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
@boring-cyborg boring-cyborg Bot added core changes to core tests test cases labels Apr 29, 2026
Copy link
Copy Markdown
Collaborator

@marcelstoer marcelstoer left a comment

Choose a reason for hiding this comment

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

It's unfortunate that we have to do this but it LGTM.

@jeremylong jeremylong added this to the 12.2.2 milestone Apr 29, 2026
@OrangeDog
Copy link
Copy Markdown
Contributor

It is RECOMMENDED that all senders and recipients support, at a minimum, URIs with lengths of 8000 octets in protocol elements.

https://www.rfc-editor.org/rfc/rfc9110#section-4.1-5

Copy link
Copy Markdown
Collaborator

@jeremylong jeremylong left a comment

Choose a reason for hiding this comment

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

4000 -> 8000

Comment thread core/src/main/resources/data/initialize.sql Outdated
Comment thread core/src/main/resources/data/initialize_mssql.sql Outdated
Comment thread core/src/main/resources/data/initialize_mysql.sql Outdated
Comment thread core/src/main/resources/data/initialize_oracle.sql
Comment thread core/src/main/resources/data/initialize_postgres.sql Outdated
Comment thread core/src/main/resources/data/upgrade_5.5.sql Outdated
@marcelstoer
Copy link
Copy Markdown
Collaborator

marcelstoer commented Apr 29, 2026

@OrangeDog That is a very valid concern, but so is the author's judgement

4000 was chosen to stay within Oracle's standard VARCHAR2(4000) limit and avoid falling back to
TEXT/CLOB on any supported dialect

Which one is the lesser evil?

steffenjacobs and others added 6 commits April 29, 2026 14:58
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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.5 to 5.6 in runtime and test dependencycheck.properties.
  • Widens the reference.url column in all dialect initialization SQL scripts.
  • Adds an H2 auto-migration script upgrade_5.5.sql to alter the column and update the schema version in properties.

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.

Comment thread core/src/main/resources/data/initialize_oracle.sql Outdated
Comment thread core/src/main/resources/data/upgrade_5.5.sql
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).
Copy link
Copy Markdown
Collaborator

@marcelstoer marcelstoer left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Collaborator

@jeremylong jeremylong left a comment

Choose a reason for hiding this comment

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

LGTM

@jeremylong
Copy link
Copy Markdown
Collaborator

I will try and release this over the weekend.

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

Labels

core changes to core tests test cases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

org.owasp.dependencycheck.data.nvdcve.DatabaseException: Error updating 'CVE-2026-6785'; Value too long for column "URL CHARACTER VARYING(1000)

10 participants