Apr 25, 2026·5 min read·19 visits
A stack exhaustion vulnerability in ParquetSharp allows an attacker to crash the host application by providing a crafted Parquet file with excessively large decimal column widths, leading to an uncatchable StackOverflowException.
ParquetSharp versions between 18.1.0 and 23.0.0.0 are vulnerable to a stack exhaustion Denial of Service (DoS) flaw. The vulnerability resides in the DecimalConverter class, where uncontrolled metadata values dictate unbounded stack allocation size.
ParquetSharp is a .NET library that provides a high-performance wrapper around the Apache Parquet C++ library. Applications use ParquetSharp to read and write Parquet files, a columnar storage format frequently employed in data engineering and analytics workloads. The vulnerability exists within the parsing mechanism for decimal data types stored as Fixed-Length Byte Arrays (FLBA).
When processing Parquet files, the library extracts metadata defining the physical structure of the columns, including the length of byte arrays used for decimal values. The DecimalConverter component utilizes this metadata to allocate memory during read operations.
The library fails to enforce an upper bound on the Length property derived from the untrusted file metadata. This architectural oversight classifies the defect as CWE-121, representing a stack-based buffer overflow specifically manifesting as stack exhaustion.
The technical root cause originates in the DecimalConverter.ReadDecimal and DecimalConverter.WriteDecimal methods. In .NET, the stackalloc keyword allows developers to allocate memory directly on the thread's execution stack rather than the managed heap. This technique bypasses garbage collection overhead and provides significant performance benefits for small, temporary buffers.
The vulnerability occurs because the stackalloc instruction receives its size parameter directly from the byteArray.Length property. This property represents the primitiveLength defined in the Parquet file's metadata schema.
Because the Parquet format allows files to self-describe their schema, an attacker maintains complete control over the primitiveLength value. When the application attempts to allocate an excessively large buffer, such as 10 megabytes, the allocation exceeds the thread's maximum stack size limit, which typically defaults to 1 megabyte in standard .NET environments.
The vulnerable implementation relies entirely on stack allocation regardless of the requested buffer size. The DecimalConverter method receives a ByteArray object and immediately initiates a stackalloc operation.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe decimal ReadDecimal(ByteArray byteArray, decimal multiplier)
{
if (byteArray.Length == 0) return new decimal(0);
// Unbounded stack allocation based on untrusted length
var tmp = stackalloc byte[byteArray.Length];
for (var byteIdx = 0; byteIdx < byteArray.Length; ++byteIdx)
{
tmp[byteArray.Length - byteIdx - 1] = *((byte*) byteArray.Pointer + byteIdx);
}
// ...
}The patch resolves this by introducing a maximum threshold for stack allocations, defined as MaxStackAllocSize with a value of 1024 bytes. If the requested typeLength is less than or equal to this constant, the code maintains the high-performance stackalloc path.
If the requested length exceeds 1024 bytes, the patched code falls back to renting a buffer from the managed heap using ArrayPool<byte>.Shared.Rent. A finally block guarantees the buffer returns to the pool after the read operation completes, preventing memory leaks while safely handling arbitrarily large metadata values.
Exploitation requires the attacker to deliver a maliciously crafted Parquet file to a vulnerable application endpoint. The attacker structures the file with a decimal-type column utilizing the FIXED_LEN_BYTE_ARRAY physical type.
The attacker then modifies the file metadata to specify a disproportionately large primitiveLength for the decimal column. The specific value only needs to exceed the target environment's thread stack limit to guarantee a crash.
When the target application instantiates a ParquetFileReader and attempts to read the compromised column, the execution flow reaches the DecimalConverter.ReadDecimal method. The following proof-of-concept snippet demonstrates the precise API call sequence that triggers the condition.
using var decimalType = LogicalType.Decimal(precision: 9, scale: 4);
using var colNode = new PrimitiveNode("value", Repetition.Required, decimalType, PhysicalType.FixedLenByteArray, primitiveLength: 10_000_000);
using var schema = new GroupNode("schema", Repetition.Required, new Node[] { colNode });
// The groupReader parses the modified schema and passes the large length
using var columnReader = groupReader.Column(0).LogicalReader<decimal>();
// ReadAll triggers the unbounded stackalloc
var values = columnReader.ReadAll((int) groupReader.MetaData.NumRows);The vulnerability consistently results in a Denial of Service condition against the host application. In the .NET runtime, a StackOverflowException fundamentally differs from standard exceptions.
The runtime immediately terminates the executing process when a stack overflow occurs. Developers cannot intercept or handle a StackOverflowException using standard try-catch blocks, making the crash unavoidable once the vulnerable execution path triggers.
This termination affects all concurrent operations running within the application process. If the vulnerable ParquetSharp implementation operates within a web service or data ingestion pipeline, a single malicious file payload will cause complete service disruption, requiring a process restart to restore availability.
Organizations must update the ParquetSharp NuGet package to version 23.0.0.1 to eliminate the vulnerability. This version incorporates the ArrayPool fallback mechanism, which neutralizes the stack exhaustion vector while preserving parsing performance for standard files.
If immediate patching is unfeasible, developers should implement pre-processing validation on incoming Parquet files. This validation layer must inspect the logical schema and reject files containing decimal columns with a primitiveLength exceeding expected operational limits.
Security teams should also review dependency trees to identify indirect usages of ParquetSharp. Static analysis tools can detect invocations of ParquetSharp.DecimalConverter.ReadDecimal or ParquetSharp.ColumnReader<decimal>.ReadAll() to prioritize remediation efforts across large codebases.
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
ParquetSharp G-Research | >= 18.1.0, < 23.0.0.1 | 23.0.0.1 |
| Attribute | Detail |
|---|---|
| Vulnerability Type | Stack Exhaustion (Denial of Service) |
| CWE ID | CWE-121 |
| Attack Vector | Local / Remote (via untrusted file) |
| CVSS Score | 5.3 (Moderate) |
| Exploit Status | Proof of Concept Available |
| KEV Status | Not Listed |
The application allocates memory on the stack based on an untrusted size parameter, leading to stack exhaustion and process crash.
An unauthenticated SQL injection and SQL execution vulnerability in SiYuan allows remote attackers to compromise the integrity and confidentiality of the asset database. The flaw exists due to string concatenation in regular expression searches and a complete lack of authorization checks on raw SQL querying pathways under default configurations. Attackers can leverage this vulnerability to exfiltrate database contents, manipulate index records, or access cross-notebook contents without any valid credentials.
CVE-2026-68587 is a critical authorization bypass vulnerability in SiYuan, an open-source personal knowledge management workspace. When deployed in publish mode, specific transaction endpoints fail to perform administrative role validation. This omission enables unauthenticated remote readers to retrieve the rendered Document Object Model (DOM) of publish-disabled (private) documents by supplying a target heading block identifier. Upgrading to version v3.7.3 or later resolves this issue by applying appropriate routing middleware constraints.
SiYuan is a privacy-first personal knowledge management system. In versions prior to v3.7.3, the application fails to apply publish-access filters to the getBacklinkDoc and getBackmentionDoc content endpoints (/api/ref/getBacklinkDoc and /api/ref/getBackmentionDoc). While the corresponding backlink list endpoints correctly filter out publish-forbidden documents, the content endpoints, which are only gated by high-level route authorization checks via CheckAuth, do not. Consequently, a user with low-privilege read access, or an anonymous reader when publish Basic Auth is disabled, can directly invoke these endpoints using a known publish-forbidden document's ID to retrieve its rendered DOM content or determine whether it references a specific target block.
A metadata disclosure vulnerability exists in SiYuan prior to version v3.7.3. The /api/block/getBlockInfo endpoint fails to validate authorization boundaries in publish mode, allowing anonymous readers to access private document metadata.
A critical authorization bypass vulnerability exists in SiYuan personal knowledge management system before v3.7.4. The /api/ref/refreshBacklink endpoint lacks administrative role verification, enabling unauthenticated users to initiate database transactions and disk operations. When combined with an unsafe SQL generation pattern in nested backlink queries, an attacker can exploit a secondary SQL injection vulnerability to compromise local databases or cause denial-of-service conditions.
A critical SQL Injection vulnerability exists in the SiYuan note-taking application (versions <= v3.7.2) due to improper neutralization of single quotes within the backlink and mention search queries. Because the application constructs SQLite Full Text Search (FTS) queries via direct string concatenation and uses a database driver that supports stacked query statements, remote unauthenticated attackers can execute arbitrary SQL commands on the master database, compromising all hosted notebooks. This issue has been fully remediated in version v3.7.4.