Skip to content

CASSANDRA-21150: Fix VerifyTest failure due to unhandled IndexOutOfBoundsException in LZ4Compressor#4604

Open
arvindKandpal-ksolves wants to merge 1 commit intoapache:trunkfrom
arvindKandpal-ksolves:CASSANDRA-21150-lz4-fix
Open

CASSANDRA-21150: Fix VerifyTest failure due to unhandled IndexOutOfBoundsException in LZ4Compressor#4604
arvindKandpal-ksolves wants to merge 1 commit intoapache:trunkfrom
arvindKandpal-ksolves:CASSANDRA-21150-lz4-fix

Conversation

@arvindKandpal-ksolves
Copy link
Contributor

Fix VerifyTest failure due to unhandled IndexOutOfBoundsException in LZ4Compressor

The recent replacement of org.lz4 with at.yawk.lz4 (to address CVE-2025-12183) changed the behavior during decompression of corrupt data. The new safe implementation throws IndexOutOfBoundsException instead of LZ4Exception when reading past array limits. This caused VerifyTest#testVerifyCorruptRowCorrectDigest to fail because the test expects an IOException (indicating corruption) but received an unhandled RuntimeException.

This patch updates LZ4Compressor to catch IndexOutOfBoundsException alongside LZ4Exception and wrap it in an IOException, restoring the correct corruption detection behavior.

patch by Arvind Kandpal; reviewed by TBD for CASSANDRA-21150

The replacement of org.lz4 with at.yawk.lz4 (for CVE-2025-12183) changed behavior during decompression of corrupt data. The new safe implementation throws IndexOutOfBoundsException instead of LZ4Exception. This commit catches both exceptions to ensure corruption is correctly detected and wrapped as IOException.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant