Repository navigation
Limit the number of array dimensions reported by PostgreSQL - #131734
Conversation
The number of dimensions of a PostgreSQL array (`attndims` or `array_ndims`) comes from the remote server and was used without a limit, each dimension adding a level of `Array`. A huge number produced a type so deep that working with it exhausted the stack and crashed the server, and a negative number from `array_ndims` made the loop run about 2^31 times. PostgreSQL itself allows at most 6 dimensions; refuse anything outside 1..100. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Workflow [PR], commit [6830258] Summary: ✅
AI ReviewSummaryThe PR limits PostgreSQL-reported array dimensions to 1–100 before constructing nested Final VerdictStatus: ✅ Approve |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 12 s compile time in total, 7 of them have a recent master baseline. |
Address review: cover an oversized `attndims` reported by the remote server. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Backport #131734 to 26.10: Limit the number of array dimensions reported by PostgreSQL
Backport #131734 to 26.9: Limit the number of array dimensions reported by PostgreSQL
Backport #131734 to 26.8: Limit the number of array dimensions reported by PostgreSQL
Backport #131734 to 26.3: Limit the number of array dimensions reported by PostgreSQL
…ons reported by PostgreSQL
The number of dimensions of a PostgreSQL array (
attndimsorarray_ndims) comes from the remote server and was used without a limit, each dimension adding a level ofArray. A huge number produced a type so deep that working with it exhausted the stack and crashed the server, and a negative number fromarray_ndimsmade the loop run about 2^31 times. PostgreSQL itself allows at most 6 dimensions; refuse anything outside 1..100.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix a possible crash of the
PostgreSQLtable engine, table function and database engine when the remote server reports an absurd number of array dimensions.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/131734]
Version info
26.11.1.2516-master(included in26.11and later)26.10.5.47,26.9.31.12,26.8.39.11,26.3.66.8