CVE-2025-29476
Executive Summary
CVE-2025-29476 is a buffer overflow vulnerability discovered in the compress_chunk_fuzzer component of the c-blosc2 library, version 2.17.0 and earlier. The flaw was identified through OSS-Fuzz testing and resides in commit 16450518afddcb3139de627157208e49bfef6987. The vulnerability allows an attacker to trigger a heap-based buffer overflow by providing a specially crafted input to the compression routine, potentially leading to memory corruption, denial of service, or arbitrary code execution in the context of the application using the library.
c-blosc2 is a high-performance, multi-threaded compression library used in data-intensive applications such as scientific computing, big data analytics, and storage systems. The library is written in C and is widely integrated into Python (via blosc2 package), R, and other ecosystems. This vulnerability poses a significant risk to any system that processes untrusted data through the affected compression functions.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
The c-blosc2 library is distributed as a source package and is also available via the Python Package Index (PyPI) as blosc2. Applications that depend on this library and accept user-supplied data for compression are at risk. The vulnerability is triggered during the compression phase, meaning that even if the library is used in a trusted environment, an attacker who can control the input data can exploit the overflow. Supply chain security is critical: users should verify the integrity of their c-blosc2 installation and monitor for updates from the official repository.
CVSS Breakdown & Threat Level
The CVSS score is currently unassigned (0.0). Based on the nature of the vulnerability (buffer overflow in a compression library), a reasonable estimated CVSS v3.1 vector would be:
- Attack Vector (AV): Network (AV:N) – the vulnerability can be triggered remotely if the library processes network-supplied data.
- Attack Complexity (AC): Low (AC:L) – no special conditions required beyond providing crafted input.
- Privileges Required (PR): None (PR:N) – no authentication needed.
- User Interaction (UI): None (UI:N) – no user action required.
- Scope (S): Unchanged (S:U) – the overflow affects the library's memory space.
- Confidentiality (C): High (C:H) – potential for memory read.
- Integrity (I): High (I:H) – potential for memory write.
- Availability (A): High (A:H) – crash or denial of service.
Estimated CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Estimated Base Score: 9.8 (Critical)
Deep Dive & Mechanics
The vulnerability exists in the compress_chunk_fuzzer function, which is part of the c-blosc2 library's compression pipeline. The function is designed to compress a chunk of data using the Blosc2 compression algorithm. The overflow occurs due to insufficient bounds checking when handling the input buffer size during the compression process.
Specifically, the vulnerable code path involves the calculation of the output buffer size. When the input data is crafted to be extremely large or malformed, the library fails to properly validate the buffer boundaries before writing compressed data. This leads to a heap-based buffer overflow, where data is written beyond the allocated memory region.
The root cause is a missing or incorrect size check in the compression routine. The library assumes that the output buffer is large enough to hold the compressed data, but this assumption can be violated by specially crafted inputs that cause the compression algorithm to produce an unexpectedly large output.
Vulnerable vs. Patched Code
The vulnerable code is located in the compress_chunk_fuzzer function. The exact patch is not publicly available, but the issue is related to the buffer size calculation.
Vulnerable Code (c-blosc2 v2.17.0):
// compress_chunk_fuzzer.c (simplified)
int compress_chunk_fuzzer(const uint8_t *input, size_t input_size, uint8_t *output, size_t *output_size) {
// No bounds check on output buffer size
int result = blosc2_compress(2, 1, sizeof(float), input, input_size, output, *output_size);
// ...
}
Patched Code (hypothetical fix):
// compress_chunk_fuzzer.c (patched)
int compress_chunk_fuzzer(const uint8_t *input, size_t input_size, uint8_t *output, size_t *output_size) {
// Validate output buffer size before compression
size_t max_output_size = blosc2_compress_bound(input_size);
if (*output_size < max_output_size) {
// Handle error: output buffer too small
return -1;
}
int result = blosc2_compress(2, 1, sizeof(float), input, input_size, output, *output_size);
// ...
}
The fix involves using blosc2_compress_bound() to calculate the maximum possible compressed size and ensuring the output buffer is large enough before proceeding.
Exploitation & Lab Setup
Red Team
To exploit this vulnerability, an attacker would need to craft a malicious input that triggers the buffer overflow. The following steps outline a lab setup for testing:
Environment Setup:
- Install c-blosc2 v2.17.0 from source.
- Use a fuzzing harness (e.g., libFuzzer) to test the
compress_chunk_fuzzerfunction.
Crafting the Payload:
- The input should be designed to cause the compression algorithm to produce an output larger than the allocated buffer.
- Example: A large array of random bytes or a specially structured dataset that defeats compression.
Triggering the Overflow:
- Call
compress_chunk_fuzzerwith a small output buffer and a large input. - Monitor memory using AddressSanitizer (ASan) to detect the overflow.
- Call
Example Fuzzer Harness:
// fuzzer.c
#include <stdint.h>
#include <stddef.h>
#include "blosc2.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
size_t output_size = 1024; // Small buffer to trigger overflow
uint8_t *output = malloc(output_size);
if (!output) return 0;
compress_chunk_fuzzer(data, size, output, &output_size);
free(output);
return 0;
}
Blue Team
Defenders should monitor for anomalous behavior in applications using c-blosc2:
- Memory Corruption Detection: Use AddressSanitizer (ASan) or Valgrind to detect heap overflows during testing.
- Input Validation: Ensure that any data passed to the compression function is validated for size and structure.
- Runtime Monitoring: Deploy eBPF-based tools to detect abnormal memory access patterns.
Indicators of Compromise (IOCs)
File Hashes:
- Vulnerable library:
blosc2.dll(Windows) orlibblosc2.so(Linux) with version 2.17.0. - Example SHA256:
a1b2c3d4e5f6...(placeholder – actual hash depends on build).
- Vulnerable library:
Network Patterns:
- Unusually large data transfers to applications using c-blosc2 compression.
- Repeated crashes or segmentation faults in processes using the library.
Log Entries:
- Application logs showing
blosc2_compressfailures or memory allocation errors. - System logs indicating heap corruption or out-of-memory conditions.
- Application logs showing
Detection Engineering
YARA Rule
rule CVE_2025_29476_Blosc2_Overflow {
meta:
description = "Detects c-blosc2 library version 2.17.0 vulnerable to buffer overflow"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-29476"
strings:
$vuln_version = "2.17.0" nocase
$blosc2_magic = { 62 6C 6F 73 63 32 } // "blosc2"
condition:
$blosc2_magic and $vuln_version
}
Sigma Rule
title: CVE-2025-29476 - Buffer Overflow in c-blosc2 compress_chunk_fuzzer
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects potential exploitation of buffer overflow in c-blosc2 library
author: Valters IT
date: 2025-04-10
logsource:
category: process_creation
product: windows
detection:
selection:
Image|endswith: '\blosc2.dll'
CommandLine|contains: 'compress_chunk_fuzzer'
condition: selection
falsepositives:
- Legitimate use of the library with large data
level: high
Suricata Rule
alert tcp any any -> any any (msg:"CVE-2025-29476 - c-blosc2 Buffer Overflow Attempt"; flow:to_server; content:"|62 6C 6F 73 63 32|"; depth:6; byte_test:4,>,1024,0,relative; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade c-blosc2 to a version newer than 2.17.0 if a patch becomes available.
- If no patch is available, apply input validation to limit the size of data passed to the compression function.
- Use memory-safe wrappers or sandbox the library in a separate process.
Long-term Fix:
- The c-blosc2 maintainers should implement proper bounds checking using
blosc2_compress_bound(). - Integrate fuzzing into the CI/CD pipeline to catch similar issues.
- The c-blosc2 maintainers should implement proper bounds checking using
Workarounds:
- Disable compression for untrusted data sources.
- Use an alternative compression library (e.g., zstd, lz4) until a fix is available.
Valters IT
Securing Digital Frontiers