GHSA-grr9-747v-xvcp: Scriban has an Infinite Recursion during Object Rendering Leads to Stack Overflow and Process Crash (Denial of Service)
When Scriban renders an object that contains a circular reference, it traverses the object’s members infinitely. Because the ObjectRecursionLimit property defaults to unlimited, this behavior exhausts the thread’s stack space, triggering an uncatchable StackOverflowException that immediately terminates the hosting process.
When rendering objects (e.g., {{ obj }}), the Scriban rendering engine recursively inspects and formats the object’s properties. To prevent infinite loops caused by deeply nested or circular data structures, TemplateContext contains an ObjectRecursionLimit property.
However, this property currently defaults to 0 (unlimited). If the data context pushed into the template contains a circular reference, the renderer will recurse indefinitely. This is especially dangerous for web applications that map user-controlled payloads (like JSON) directly to rendering contexts, or for applications that pass ORM objects (like Entity Framework models, which frequently contain circular navigation properties) into the template.
References
Code Behaviors & Features
Detect and mitigate GHSA-grr9-747v-xvcp with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →