Sceawere
Vulnerability Detail
CVE-2026-74791UPDATED Verified Sceawere Triage Sources: NVD / CISA KEV
Scriban Context Template Caching Vulnerability
Vulnerability Metadata
- Severity
- High
- Score / CVSS
- 8.6
- Creation Date
- 7h ago
- Vendor
- scriban
- Product
- scriban
- Attack Type
- Sensitive Information in Resource Not Removed Before Reuse
- Vector String
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N
- Attack Complexity
- LOW
Narrative and Response
Description
Scriban before 7.0.0 fails to clear the CachedTemplates dictionary when TemplateContext.Reset() is called, allowing cached templates to persist across reused contexts. Attackers can exploit request-dependent ITemplateLoader implementations to access previously authorized template content from earlier renders without triggering TemplateLoader.Load() again.
Executive Summary
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Technical Details
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Mitigations
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
References
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Additional Metadata
{
"score": "8.6",
"pubDate": "2026-08-16T14:16:57.183Z",
"pubdate": "2026-08-16T14:16:57.183Z",
"executiveSummary": "Scriban before 7.0.0 suffers from a state management flaw in the template context reset mechanism, specifically failing to clear the CachedTemplates dictionary upon calling TemplateContext.Reset(). This vulnerability allows previously cached templates to persist across reused rendering contexts.\nThe primary impact of this flaw is unauthorized cross-request information disclosure. When applications reuse template contexts alongside request-dependent ITemplateLoader implementations, subsequent render operations may serve cached template content from earlier, potentially higher-privileged requests without invoking TemplateLoader.Load() again.\nThe affected product is Scriban in versions prior to 7.0.0. Risk implications include the bypass of authorization boundaries implemented within custom template loaders, leading to the leakage of sensitive template content to unauthorized users.\nAn attacker can exploit this vulnerability by leveraging request-dependent ITemplateLoader behavior in environments where template contexts are pooled or reused across multiple distinct client sessions or security contexts. Successful exploitation requires the application to reuse context instances and depend on dynamic, request-specific template loading logic.",
"technicalDetails": "The vulnerability resides within the state reset logic of the Scriban template engine, specifically in the TemplateContext.Reset() method. The vulnerable component fails to properly invalidate or clear internal cache structures, notably the CachedTemplates dictionary, when the context object is cleared for reuse.\nIn applications designed for high performance, template contexts are frequently pooled and recycled across multiple independent requests. When an application utilizes a custom ITemplateLoader that resolves templates based on request-dependent parameters—such as tenant identifiers, user roles, or session data—the caching mechanism becomes a security liability. Because CachedTemplates retains compiled templates from prior execution cycles, subsequent rendering operations retrieve cached artifacts directly from memory rather than querying the ITemplateLoader.Load() method.\nThe step-by-step attack flow proceeds as follows: First, a high-privilege user or a different tenant initiates a request that triggers the loading and compilation of sensitive templates through the ITemplateLoader. These templates are stored in the TemplateContext instance's CachedTemplates dictionary. Second, the context is returned to a pool or reused for a subsequent, unprivileged request without clearing the internal cache. Third, the unprivileged user requests a template with the same lookup key or triggers a render operation where the stale cache entry is matched. Finally, the engine serves the previously cached, sensitive template content to the unauthorized user, completely bypassing any authorization checks or dynamic loading logic implemented within TemplateLoader.Load().\nThe affected versions include all Scriban releases prior to 7.0.0. The vulnerability does not require authentication to exploit if the underlying application exposes endpoints that reuse contexts across unauthenticated and authenticated sessions. Network exposure depends entirely on the host application's architecture and how it exposes template rendering functionality to end users."
}