CVE-2023-34454: Integer Overflow vulnerability in snappy-java's compress leads to DoS

Summary

15/06/2023
Yes i
Moderate
5.9

CVE-2023-34454: snappy-java's Integer Overflow vulnerability in compress leads to DoS. Affects org.xerial.snappy:snappy-java versions < 1.1.10.1. Fixed in 1.1.10.1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The snappy-java package is a Java port of the Snappy compression algorithm. It provides a fast and efficient way to compress and decompress data in Java applications. The package is widely used in various Java projects for its performance and simplicity. However, a vulnerability has been discovered in the compress function of snappy-java, which can lead to a Denial of Service (DoS) attack.

Vulnerability Detail

The compress function in snappy-java's Snappy.java file is susceptible to an Integer Overflow vulnerability. When compressing an array of characters, the length of the input array is multiplied by 2 without proper validation. This multiplication can result in an integer overflow, causing an unrecoverable fatal error. The rawCompress function then uses the potentially negative length to allocate a byte array, leading to a java.lang.NegativeArraySizeException or a fatal Access Violation error. This vulnerability affects multiple data types, including char, double, float, int, long, and short.

How To Fix

Minimum fixed version

1.1.10.1

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If updating the snappy-java package is not immediately feasible, a possible workaround is to avoid using the compress function with the affected data types (char, double, float, int, long, and short). Instead, consider using byte arrays for compression, as creating a byte array of a negative size is not possible. However, this workaround may not be applicable in all scenarios and should be thoroughly tested.

Conclusion

The Integer Overflow vulnerability in snappy-java's compress function can lead to a Denial of Service (DoS) attack. It is crucial to update the snappy-java package to version 1.1.10.1 or later to mitigate the risk. If immediate update is not possible, consider applying the provided workaround or disabling the usage of the compress function with the affected data types. For additional support and guidance, contact DevNack.com.

See every vulnerability recorded for org.xerial.snappy:snappy-java →

Share this vulnerability

FAQ

The vulnerability can lead to a Denial of Service (DoS) attack, causing the affected Java application to crash or become unresponsive.

You can use Vulert's playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities, using just the pom.xml file of your application.

At the time of this report, there are no known public exploits targeting this vulnerability. However, it is important to promptly update the snappy-java package to mitigate the risk of a DoS attack.

While updating the snappy-java package is the recommended solution, if immediate update is not feasible, you can consider implementing the provided workaround or disabling the usage of the compress function with the affected data types.

For further support on vulnerability remediation and assistance in securing your Java application, you can reach out to info@devnack.com.

Related vulnerabilities

Recent vulnerabilities recorded for org.xerial.snappy:snappy-java.

How To Fix

Minimum fixed version

1.1.10.1

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback