fix(plugins): guard type-expression helper recursion in py/cs/ts — DoS hardening (v0.4.1) #3
No reviewers
Labels
No labels
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
h-dv/code-index!3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/parser-typehelper-recursion-guard"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes the residual security item noted in the v0.4.0 ultradeep review.
Problem
v0.4.0 capped every plugin's
walkrecursion, but the self-recursive TYPE-ref helpers in the Python, C#, and TypeScript plugins (emit_type_ref/emit_receiver_type_refs) were still unbounded. A crafted file with a deeply nested type expression —List[List[...]],List<List<...>>,Array<Array<...>>— is reached via a shallow walk but then recurses thousands of levels inside the helper, overflowing the worker stack and SIGABRT-ing the daemon.catch_unwindcan't intercept stack exhaustion.Fix
Each helper now routes through a depth-aware
_dcore guarded bycommon::MAX_PARSE_DEPTH; the public method is a thin wrapper, so all call sites and extraction behavior are unchanged. PHP's type helper is structurally flat (union/qualified shapes can't nest) and needs no guard.Verification
lang_e2e(55),gap_fill(20),correctness(6) unaffected — the type-ref parity behavior is identical.Patch bump → v0.4.1.
🤖 Generated with Claude Code