Skip to content

Bound type-tree nesting depth when reading the footer - #23

Merged
Algunenano merged 1 commit into
ClickHouse/2.1.2from
deep-type-nesting-limit
Jun 15, 2026
Merged

Bound type-tree nesting depth when reading the footer#23
Algunenano merged 1 commit into
ClickHouse/2.1.2from
deep-type-nesting-limit

Conversation

@Algunenano

Copy link
Copy Markdown
Member

According to apache#2632 the library vulnerabilities are not such:

A crash, Out-Of-Memory (OOM), Out-Of-Bounds (OOB) read, or assertion failure caused by feeding a maliciously fuzzed file directly into the low-level parser is considered a **robustness issue** (a regular software bug), not a security vulnerability.

Our model does not match this, and we handle any input. Thus we must prevent stack overflows when parsing types

convertType recurses over the file-controlled type tree (LIST/MAP/UNION/STRUCT)
described by the footer with no depth bound, so a crafted deeply nested schema
overflows the native stack here (and later in assignIds/buildTypeNameIdMap which
walk the same tree). Reject nesting deeper than a fixed limit, far above any
legitimate schema, with a ParseError instead of crashing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions github-actions Bot added the CPP label Jun 15, 2026
@Algunenano
Algunenano merged commit 49e9657 into ClickHouse/2.1.2 Jun 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant