Skip to content

fix(security): Upgrade druid version to 35.0.1#26820

Merged
nishithakbhaskaran merged 1 commit intoprestodb:masterfrom
ShahimSharafudeen:lz4-java_cve_fix_druid
Feb 18, 2026
Merged

fix(security): Upgrade druid version to 35.0.1#26820
nishithakbhaskaran merged 1 commit intoprestodb:masterfrom
ShahimSharafudeen:lz4-java_cve_fix_druid

Conversation

@ShahimSharafudeen
Copy link
Contributor

@ShahimSharafudeen ShahimSharafudeen commented Dec 17, 2025

Description

Upgrade druid to version 35.0.1 to address CVE-2024-53990 and CVE-2025-12183

Since the CVE fixes for lz4-java and Rhino are not included in Druid 35.0.1, we resolved the vulnerabilities by upgrading the corresponding transitive dependencies.

Upgrade lz4-java to version 1.10.2 to address CVE-2025-66566
Upgrade rhino to version 1.8.1 to address CVE-2025-66453

Motivation and Context

Impact

Test Plan

Tested in Local :

presto> show tables from druid.wikipedia;

Query 20260101_125243_00001_dkgk2, RUNNING, 1 node, 19 splits

Query 20260101_125243_00001_dkgk2, RUNNING, 1 node, 19 splits

Query 20260101_125243_00001_dkgk2, RUNNING, 1 node, 19 splits
      Table      
-----------------
 car_details     
 employee        
 employee_data   
 employee_druid2 
 inline_data     
 kttm1           
 order_details   
 product_table   
 sales_report    
 student_details 
 wikipedia       
(11 rows)

Query 20260101_125243_00001_dkgk2, FINISHED, 1 node
Splits: 19 total, 19 done (100.00%)
[Latency: client-side: 0:07, server-side: 0:07] [11 rows, 334B] [1 rows/s, 49B/s]

presto> select * from druid.wikipedia.employee_data limit 10;
         __time          | employee_id |      name       | department  | salary 
-------------------------+-------------+-----------------+-------------+--------
 2010-01-01 05:30:00.000 |         101 | John Doe        | Marketing   |  60000 
 2010-01-01 05:30:00.000 |         102 | Jane Smith      | Sales       |  70000 
 2010-01-01 05:30:00.000 |         103 | Michael Johnson | Engineering |  80000 
 2010-01-01 05:30:00.000 |         104 | Emily Davis     | Finance     |  75000 
(4 rows)

Query 20260101_125342_00002_dkgk2, FINISHED, 1 node
Splits: 17 total, 17 done (100.00%)
[Latency: client-side: 0:03, server-side: 0:03] [4 rows, 224B] [1 rows/s, 85B/s]

presto> select * from druid.wikipedia.employee_data limit 3;
         __time          | employee_id |      name       | department  | salary 
-------------------------+-------------+-----------------+-------------+--------
 2010-01-01 05:30:00.000 |         101 | John Doe        | Marketing   |  60000 
 2010-01-01 05:30:00.000 |         102 | Jane Smith      | Sales       |  70000 
 2010-01-01 05:30:00.000 |         103 | Michael Johnson | Engineering |  80000 
(3 rows)

Query 20260101_125409_00003_dkgk2, FINISHED, 1 node
Splits: 17 total, 17 done (100.00%)
[Latency: client-side: 0:02, server-side: 0:02] [3 rows, 169B] [1 rows/s, 78B/s]

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.
  • If adding new dependencies, verified they have an OpenSSF Scorecard score of 5.0 or higher (or obtained explicit TSC approval for lower scores).

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== RELEASE NOTES ==

Security Changes
* Upgrade Druid to version 35.0.1 to address `CVE-2024-53990 <https://github.com/advisories/GHSA-mfj5-cf8g-g2fv>`_ and `CVE-2025-12183 <https://github.com/advisories/GHSA-vqf4-7m7x-wgfc>`_.
* Upgrade lz4-java to version 1.10.2 to address `CVE-2025-66566 <https://github.com/advisories/GHSA-cmp6-m4wj-q63q>`_.
* Upgrade Rhino to version 1.8.1 to address `CVE-2025-66453 <https://github.com/advisories/GHSA-3w8q-xq97-5j7x>`_.

@prestodb-ci prestodb-ci added the from:IBM PR from IBM label Dec 17, 2025
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 17, 2025

Reviewer's Guide

Upgrades the Druid dependency to 35.0.1 and introduces a custom PrestoQueryableIndex implementation plus API-adjustment shims to align with the newer Druid segment APIs, while explicitly pinning lz4-java and Rhino versions to remediate security vulnerabilities.

Sequence diagram for V9SegmentIndexSource.loadIndex using PrestoQueryableIndex

sequenceDiagram
    participant Caller
    participant V9SegmentIndexSource
    participant SegmentColumnSource
    participant GenericIndexed
    participant ColumnDescriptor
    participant PrestoQueryableIndex

    Caller->>V9SegmentIndexSource: loadIndex(columnHandles)
    V9SegmentIndexSource->>SegmentColumnSource: getColumnData(INDEX_METADATA_FILE_NAME)
    SegmentColumnSource-->>V9SegmentIndexSource: byte[] indexData
    V9SegmentIndexSource->>V9SegmentIndexSource: wrap in ByteBuffer indexBuffer

    V9SegmentIndexSource->>GenericIndexed: read(indexBuffer, STRING_STRATEGY, null)
    GenericIndexed-->>V9SegmentIndexSource: GenericIndexed dummyRead
    V9SegmentIndexSource->>GenericIndexed: read(indexBuffer, STRING_STRATEGY, null)
    GenericIndexed-->>V9SegmentIndexSource: GenericIndexed allDimensions

    V9SegmentIndexSource->>V9SegmentIndexSource: parse Interval dataInterval
    V9SegmentIndexSource->>V9SegmentIndexSource: build availableDimensions list

    loop each columnName
        V9SegmentIndexSource->>SegmentColumnSource: getColumnData(columnName)
        SegmentColumnSource-->>V9SegmentIndexSource: byte[] columnData
        V9SegmentIndexSource->>V9SegmentIndexSource: wrap in ByteBuffer columnBuffer
        V9SegmentIndexSource->>ColumnDescriptor: read(columnBuffer, ColumnConfig.DEFAULT, null, null)
        ColumnDescriptor-->>V9SegmentIndexSource: ColumnHolder columnHolder
        V9SegmentIndexSource->>V9SegmentIndexSource: put Supplier in columns map
    end

    V9SegmentIndexSource->>V9SegmentIndexSource: build Indexed availableDimensions

    V9SegmentIndexSource->>PrestoQueryableIndex: new PrestoQueryableIndex(dataInterval, availableDimensions, columns, metadata, segmentBitmapSerdeFactory.getBitmapFactory())
    PrestoQueryableIndex-->>V9SegmentIndexSource: QueryableIndex instance

    V9SegmentIndexSource-->>Caller: QueryableIndex
Loading

Class diagram for new PrestoQueryableIndex and its usage in V9SegmentIndexSource

classDiagram
    direction LR

    class V9SegmentIndexSource {
        -SegmentColumnSource segmentColumnSource
        -SegmentBitmapSerdeFactory segmentBitmapSerdeFactory
        +V9SegmentIndexSource(SegmentColumnSource segmentColumnSource)
        +QueryableIndex loadIndex(List columnHandles) IOException
        -ColumnDescriptor readColumnDescriptor(ByteBuffer byteBuffer) IOException
        -ColumnHolder createColumnHolder(String columnName)
    }

    class PrestoQueryableIndex {
        -Interval dataInterval
        -Indexed availableDimensions
        -Map~String, Supplier~ColumnHolder~~ columns
        -Metadata metadata
        -BitmapFactory bitmapFactory
        +PrestoQueryableIndex(Interval dataInterval, Indexed availableDimensions, Map~String, Supplier~ColumnHolder~~ columns, Metadata metadata, BitmapFactory bitmapFactory)
        +Interval getDataInterval()
        +int getNumRows()
        +Indexed getAvailableDimensions()
        +List~String~ getColumnNames()
        +BaseColumnHolder getColumnHolder(String columnName)
        +Metadata getMetadata()
        +List~OrderBy~ getOrdering()
        +Map~String, DimensionHandler~ getDimensionHandlers()
        +BitmapFactory getBitmapFactoryForDimensions()
        +void close()
    }

    class QueryableIndex {
        <<interface>>
        +Interval getDataInterval()
        +int getNumRows()
        +Indexed getAvailableDimensions()
        +List~String~ getColumnNames()
        +BaseColumnHolder getColumnHolder(String columnName)
        +Metadata getMetadata()
        +List~OrderBy~ getOrdering()
        +Map~String, DimensionHandler~ getDimensionHandlers()
        +BitmapFactory getBitmapFactoryForDimensions()
        +void close()
    }

    class ColumnDescriptor {
        +ColumnHolder read(ByteBuffer byteBuffer, ColumnConfig columnConfig, Object arg1, Object arg2) IOException
    }

    class GenericIndexed {
        +static GenericIndexed read(ByteBuffer buffer, Object strategy, Object arg)
    }

    class SegmentColumnSource {
        +byte[] getColumnData(String columnName)
    }

    class SegmentBitmapSerdeFactory {
        +BitmapFactory getBitmapFactory()
    }

    V9SegmentIndexSource --> SegmentColumnSource : uses
    V9SegmentIndexSource --> SegmentBitmapSerdeFactory : uses
    V9SegmentIndexSource --> PrestoQueryableIndex : creates
    PrestoQueryableIndex ..|> QueryableIndex
    V9SegmentIndexSource --> ColumnDescriptor : reads
    V9SegmentIndexSource --> GenericIndexed : uses static read
Loading

File-Level Changes

Change Details Files
Update Druid integration code to match new 35.x segment/index APIs and switch to a custom QueryableIndex implementation.
  • Remove NullHandling.initializeForTests() from V9SegmentIndexSource constructor since new Druid version no longer requires this manual initialization.
  • Adjust GenericIndexed.read(...) calls to use the new method signature that includes an additional parameter (passing null).
  • Update ColumnDescriptor.read(...) calls to use the new four-argument signature, passing null for the new argument.
  • Replace usage of SimpleQueryableIndex with a new PrestoQueryableIndex implementation that wraps Presto’s column suppliers and carries metadata and bitmap factory.
presto-druid/src/main/java/com/facebook/presto/druid/segment/V9SegmentIndexSource.java
presto-druid/src/main/java/com/facebook/presto/druid/segment/PrestoQueryableIndex.java
Introduce PrestoQueryableIndex as a minimal QueryableIndex implementation tailored for Presto’s Druid connector.
  • Store data interval, available dimensions, column supplier map, optional metadata, and bitmap factory as fields.
  • Implement QueryableIndex methods to expose interval, dimensions, column names, column holders (via suppliers), metadata, ordering, dimension handlers, bitmap factory, and a no-op close().
  • Return empty ordering and dimension handlers, and a fixed row count of 0, deferring row semantics to Presto’s existing scan logic.
presto-druid/src/main/java/com/facebook/presto/druid/segment/PrestoQueryableIndex.java
Update Maven dependency versions to new Druid and security-patched transitive libraries and correct the hibernate-validator groupId.
  • Bump the global Druid dependency property from 30.0.1 to 35.0.1 in the root pom.xml.
  • Change the Hibernate Validator dependencyManagement entry to use groupId org.hibernate.validator instead of org.hibernate.
  • Add explicit dependencyManagement entries for at.yawk.lz4:lz4-java:1.10.2 and org.mozilla:rhino:1.8.1 to override vulnerable transitive versions in Druid.
pom.xml
presto-druid/pom.xml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@ShahimSharafudeen ShahimSharafudeen force-pushed the lz4-java_cve_fix_druid branch 2 times, most recently from a3b3aad to 3cf9e4b Compare December 23, 2025 13:17
@ShahimSharafudeen ShahimSharafudeen marked this pull request as ready for review December 24, 2025 06:35
@ShahimSharafudeen ShahimSharafudeen requested a review from a team as a code owner December 24, 2025 06:35
@prestodb-ci prestodb-ci requested review from a team, bibith4 and jkhaliqi and removed request for a team December 24, 2025 06:35
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • In PrestoQueryableIndex, getNumRows() currently returns 0 and getOrdering() / getDimensionHandlers() return empty collections; if this index is used by any code paths that rely on row counts, ordering, or dimension handlers, consider wiring these up to the underlying column data (or adding a short comment explaining why these can safely be empty/zero in this context).
  • In PrestoQueryableIndex.getColumnHolder, you are casting ColumnHolder to BaseColumnHolder; if some implementations are not BaseColumnHolder, this will fail at runtime, so consider returning ColumnHolder directly (if the interface allows) or adding a type check with a clearer failure mode.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `PrestoQueryableIndex`, `getNumRows()` currently returns 0 and `getOrdering()` / `getDimensionHandlers()` return empty collections; if this index is used by any code paths that rely on row counts, ordering, or dimension handlers, consider wiring these up to the underlying column data (or adding a short comment explaining why these can safely be empty/zero in this context).
- In `PrestoQueryableIndex.getColumnHolder`, you are casting `ColumnHolder` to `BaseColumnHolder`; if some implementations are not `BaseColumnHolder`, this will fail at runtime, so consider returning `ColumnHolder` directly (if the interface allows) or adding a type check with a clearer failure mode.

## Individual Comments

### Comment 1
<location> `presto-druid/src/main/java/com/facebook/presto/druid/segment/PrestoQueryableIndex.java:58-65` </location>
<code_context>
+        this.bitmapFactory = bitmapFactory;
+    }
+
+    @Override
+    public Interval getDataInterval()
+    {
+        return dataInterval;
+    }
+
+    @Override
+    public int getNumRows()
+    {
+        return 0;
</code_context>

<issue_to_address>
**issue (bug_risk):** getNumRows() returning 0 is likely incorrect and can break consumers relying on row count.

Always returning 0 will cause any cardinality-based logic (planning, filters, sanity checks) to treat this segment as empty. If the actual row count is known, pass it through instead of hardcoding. If it truly isn’t available, make that explicit (e.g., documented limitation) and consider returning a reasonable estimate rather than 0.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Indexed<String> indexed = new ListIndexed<>(availableDimensions);
// TODO: get rid of the time column by creating Presto's SimpleQueryableIndex impl
return new SimpleQueryableIndex(
return new PrestoQueryableIndex(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In Druid 35.0.1, the SimpleQueryableIndex class was changed from a concrete class to an abstract class. This introduced a breaking API change that prevents direct instantiation using the new keyword. Therefore, I created PrestoQueryableIndex, a custom concrete implementation of the QueryableIndex interface.

public V9SegmentIndexSource(SegmentColumnSource segmentColumnSource)
{
this.segmentColumnSource = requireNonNull(segmentColumnSource, "segmentColumnSource is null");
NullHandling.initializeForTests();
Copy link
Contributor

Choose a reason for hiding this comment

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

@ShahimSharafudeen Could you please clarify why this line was removed, since it prevents the IllegalStateException that occurs when the code checks null-handling logic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In Apache Druid 35.0.1, the old null-handling legacy behavior and associated configs/constants (often referred to as NullHandling, druid.generic.useDefaultValueForNull, etc.) have been deprecated and removed because the project has fully moved to ANSI SQL–compliant null semantics, and the legacy behavior is no longer supported.

bibith4
bibith4 previously approved these changes Jan 1, 2026
Copy link
Contributor

@bibith4 bibith4 left a comment

Choose a reason for hiding this comment

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

LGTM

@prestodb-ci
Copy link
Contributor

@ShahimSharafudeen imported this issue as lakehouse/presto #26820

Copy link
Contributor

@pratyakshsharma pratyakshsharma left a comment

Choose a reason for hiding this comment

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

Thank you for making the changes as discussed.

@steveburnett
Copy link
Contributor

Thanks for the release note! Some formatting nits:

== RELEASE NOTES ==

Security Changes
* Upgrade Druid to version 35.0.1 to address `CVE-2024-53990 <https://github.com/advisories/GHSA-mfj5-cf8g-g2fv>`_ and `CVE-2025-12183 <https://github.com/advisories/GHSA-vqf4-7m7x-wgfc>`_.
* Upgrade lz4-java to version 1.10.2 to address `CVE-2025-66566 <https://github.com/advisories/GHSA-cmp6-m4wj-q63q>`_.
* Upgrade Rhino to version 1.8.1 to address `CVE-2025-66453 <https://github.com/advisories/GHSA-3w8q-xq97-5j7x>`_.

@ShahimSharafudeen
Copy link
Contributor Author

Thanks for the release note! Some formatting nits:

== RELEASE NOTES ==

Security Changes
* Upgrade Druid to version 35.0.1 to address `CVE-2024-53990 <https://github.com/advisories/GHSA-mfj5-cf8g-g2fv>`_ and `CVE-2025-12183 <https://github.com/advisories/GHSA-vqf4-7m7x-wgfc>`_.
* Upgrade lz4-java to version 1.10.2 to address `CVE-2025-66566 <https://github.com/advisories/GHSA-cmp6-m4wj-q63q>`_.
* Upgrade Rhino to version 1.8.1 to address `CVE-2025-66453 <https://github.com/advisories/GHSA-3w8q-xq97-5j7x>`_.

Thank you, @steveburnett, for the review. I have updated the release notes according to your feedback.

@steveburnett
Copy link
Contributor

Thanks for the release note! Some formatting nits:

== RELEASE NOTES ==

Security Changes
* Upgrade Druid to version 35.0.1 to address `CVE-2024-53990 <https://github.com/advisories/GHSA-mfj5-cf8g-g2fv>`_ and `CVE-2025-12183 <https://github.com/advisories/GHSA-vqf4-7m7x-wgfc>`_.
* Upgrade lz4-java to version 1.10.2 to address `CVE-2025-66566 <https://github.com/advisories/GHSA-cmp6-m4wj-q63q>`_.
* Upgrade Rhino to version 1.8.1 to address `CVE-2025-66453 <https://github.com/advisories/GHSA-3w8q-xq97-5j7x>`_.

Thank you, @steveburnett, for the review. I have updated the release notes according to your feedback.

Thank you @ShahimSharafudeen! Having good release notes in the PR helps us at the end of the release cycle, by reducing the work needed for the PR to add the release notes to the documentation (example #26726 ). Because the release notes documentation PR is a blocker for the Presto release cycle, reducing the work needed to merge that doc PR helps us get the new Presto release out faster.

@ShahimSharafudeen
Copy link
Contributor Author

@tdcmeehan — Could you please review this at your convenience?

@nishithakbhaskaran nishithakbhaskaran merged commit a5e12fd into prestodb:master Feb 18, 2026
80 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

from:IBM PR from IBM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants