GHSA-5wr9-m6jw-xx44 — scriban
CRITICALGHSA-5wr9-m6jw-xx44 is a critical-severity (CVSS 9.1) CWE-693 vulnerability in scriban. A fix is available for scriban — see the affected versions and patch details below.
Scriban: Sandbox escape due to TypedObjectAccessorcache bypassing MemberFilter after TemplateContext reuse
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- A successful exploit gives an attacker total control of the affected component, not partial access.
Exploitation and automatability from CISA’s SSVC triage for GHSA-5wr9-m6jw-xx44.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
How urgent is this, really
GHSA-5wr9-m6jw-xx44 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.
Where this sits among everything scored
Of 377,333 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.
Real-World Exposure
scriban.NETScriban.SignedReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects NuGet packages — download data is not available via public APIs for these ecosystems.
Description
Summary
TemplateContext caches type accessors by Type only, but those accessors are built using the current MemberFilter and MemberRenamer. When a TemplateContext is reused and the filter is tightened for a later render, Scriban still reuses the old accessor and continues exposing members that should now be hidden.
Details
The relevant code path is:
TemplateContext.GetMemberAccessor()caches accessors in_memberAccessorsbyTypeinsrc/Scriban/TemplateContext.cslines 850–863.- For plain .NET objects,
GetMemberAccessorImpl()creates a newTypedObjectAccessor(type, _keyComparer, MemberFilter, MemberRenamer)insrc/Scriban/TemplateContext.cslines 909–939. TypedObjectAccessorstores the current filter and precomputes the exposed member set in its constructor andPrepareMembers()insrc/Scriban/Runtime/Accessors/TypedObjectAccessor.cslines 33–40 and 119–179.- Member access later goes through
ScriptMemberExpression.GetValue()insrc/Scriban/Syntax/Expressions/ScriptMemberExpression.cslines 67–95, which uses the cached accessor. TemplateContext.Reset()does not clear_memberAccessorsinsrc/Scriban/TemplateContext.cslines 877–902.
As a result, once a permissive accessor has been created for a given type, changing TemplateContext.MemberFilter later does not take effect for that type on the same reused context.
This is especially relevant because the Scriban docs explicitly recommend TemplateContext.MemberFilter for indirect .NET object exposure.
Proof of Concept
Setup
mkdir scriban-poc2
cd scriban-poc2
dotnet new console --framework net8.0
dotnet add package Scriban --version 6.6.0
Program.cs
using System.Reflection;
using Scriban;
using Scriban.Runtime;
var template = Template.Parse("{{ model.secret }}");
var context = new TemplateContext
{
EnableRelaxedMemberAccess = false
};
var globals = new ScriptObject();
globals["model"] = new SensitiveModel();
context.PushGlobal(globals);
context.MemberFilter = _ => true;
Console.WriteLine("first=" + template.Render(context));
context.Reset();
var globals2 = new ScriptObject();
globals2["model"] = new SensitiveModel();
context.PushGlobal(globals2);
context.MemberFilter = member => member.Name == nameof(SensitiveModel.Public);
Console.WriteLine("second=" + template.Render(context));
sealed class SensitiveModel
{
public string Public => "ok";
public string Secret => "leaked";
}
Run
dotnet run
Actual Output
first=leaked
second=leaked
Expected Behavior
The second render should fail or stop exposing Secret, because the filter only allows Public and EnableRelaxedMemberAccess is disabled.
This reproduces a direct filter bypass caused by the stale cached accessor.
Impact
This is a protection-mechanism bypass. Applications that use TemplateContext.MemberFilter as part of their sandbox or object-exposure policy can unintentionally expose hidden members across requests when they reuse a TemplateContext.
The impact includes:
- Unauthorized read access to filtered properties or fields
- Unauthorized writes if the filtered member also has a setter
- Policy bypass across requests, users, or tenants when contexts are pooled
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| .NETNuGet | scriban | all versions | 7.0.0dotnet add package scriban --version 7.0.0 |
| .NETNuGet | Scriban.Signed | all versions | 7.0.0dotnet add package Scriban.Signed --version 7.0.0 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for scriban, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update scriban to 7.0.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-5wr9-m6jw-xx44 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-5wr9-m6jw-xx44 can be triaged on real exposure rather than presence alone.
Tailored to GHSA-5wr9-m6jw-xx44. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-5wr9-m6jw-xx44 in your dependencies?
O3 Security finds GHSA-5wr9-m6jw-xx44 across NuGet dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.