From 488a8a85057397f98c6565fdbbbd0bba13360442 Mon Sep 17 00:00:00 2001 From: Adeel Ahmad Date: Sun, 18 Oct 2026 06:03:22 +0000 Subject: [PATCH 1/2] docs(threat-model): bound patterns in automations' conditions under ReDoS Members write the matches patterns of automations' conditions and they run on outside text; the threat model now says how they are bounded: nested repeats and repeated alternatives that start alike are refused, a value is read only so far and a slow pattern gives up. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01AjJqXgjj1cNdKGRQbX5frb --- threat-model.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/threat-model.md b/threat-model.md index c85412f2b..7ef633c3f 100644 --- a/threat-model.md +++ b/threat-model.md @@ -650,7 +650,9 @@ its person can read; "read" does not mean "public". - **Prompt injection**: bounded by the person's tools, not by filtering (N-PROMPT). **Bombs**: not bounded beyond upload size and page caps (N-BOMBS). **ReDoS**: Cypher refuses nested repeats heuristically; admin regexes are - trusted (Q25). **XXE and billion laughs**: RDF/XML is refused (N-RDF-XML); docx XML goes to the stdlib parser (Q22). + trusted (Q25). Patterns in automations' conditions (`matches`, which members write and which run on outside text) + refuse nested repeats and repeated alternatives that start alike, read at most 20,000 characters and give up after + 50 ms each. **XXE and billion laughs**: RDF/XML is refused (N-RDF-XML); docx XML goes to the stdlib parser (Q22). - **SSRF**: in model for non-admin URLs (P-SSRF-GUARD) and guarded admin operands (P-ADMIN-GUARD); out for other admin URLs (N-ADMIN). **CSRF**: no cookies on the API (N-CSRF), except the IIIF flow (Q1). - **Brute force and volume DoS**: out beyond the sign-in throttles (N-VOLUME, N-THROTTLE-SCOPE). **Clickjacking**: From 464c0b5e96987eec1874b23a9ced38f5e2553aa3 Mon Sep 17 00:00:00 2001 From: Adeel Ahmad Date: Sun, 18 Oct 2026 06:05:06 +0000 Subject: [PATCH 2/2] docs(threat-model): the companions carry the pattern bounds Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01AjJqXgjj1cNdKGRQbX5frb --- threat-model.json | 2 +- threat-model.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/threat-model.json b/threat-model.json index c723bb66d..939c57418 100644 --- a/threat-model.json +++ b/threat-model.json @@ -686,7 +686,7 @@ "parameter": "/api/v1/automations (save, try, run now, decide, draft from a sentence), the MCP and assistant automation tools: triggers, where and If match trees, the event workflow graph (action params are Jinja templates), policy, limits, an activity id; the text of the activities an automation runs on", "attacker_controllable": "yes", "component": "assistant", - "caller_must_enforce": "none — it runs as its maker with their permissions at run time (P-AUTOMATION-ACTOR); actions reaching outside Lens ask first; outside text marks intents untrusted and breaks up links (P-INJECTION-EGRESS); chains and bursts are bounded (P-AUTOMATION-LOOP)", + "caller_must_enforce": "none — it runs as its maker with their permissions at run time (P-AUTOMATION-ACTOR); actions reaching outside Lens ask first; outside text marks intents untrusted and breaks up links (P-INJECTION-EGRESS); chains and bursts are bounded (P-AUTOMATION-LOOP); `matches` patterns refuse nested repeats and repeated alternatives that start alike, read at most 20,000 characters and give up after 50 ms", "provenance": "documented", "source": "docs/automations.md \"Running automations\"" }, diff --git a/threat-model.yaml b/threat-model.yaml index 3f06d498c..68593e656 100644 --- a/threat-model.yaml +++ b/threat-model.yaml @@ -664,7 +664,7 @@ entry_points: attacker_controllable: true x-condition: "any editor, for automations in namespaces they edit; indirectly through activity text (mail, titles, chat) that reaches action params" control_kinds: [callback/code, data, x-prompt-injection] - caller_must_enforce: "none — it runs as its maker with their permissions at run time (P-AUTOMATION-ACTOR); actions reaching outside Lens ask first; outside text marks intents untrusted and breaks up links (P-INJECTION-EGRESS); chains and bursts are bounded (P-AUTOMATION-LOOP)" + caller_must_enforce: "none — it runs as its maker with their permissions at run time (P-AUTOMATION-ACTOR); actions reaching outside Lens ask first; outside text marks intents untrusted and breaks up links (P-INJECTION-EGRESS); chains and bursts are bounded (P-AUTOMATION-LOOP); `matches` patterns refuse nested repeats and repeated alternatives that start alike, read at most 20,000 characters and give up after 50 ms" provenance: {kind: documented, source: 'docs/automations.md "Running automations"'} - id: "code sandbox" component: assistant