CVE-2026-59220: Open WebUI: ReDoS in skill-mention regexes causes whole-instance DoS on default config
Open WebUI 0.9.2 to 0.9.6 has a regular expression denial of service in the skill-mention parser. One chat message with `<$` followed by a long run with no `>` pins the CPU and freezes the whole instance for every user, on the default single-worker setup. Upgrade open-webui to 0.10.0. There is no 0.9.7.
Published Jul 24, 2026 · Analysis Oct 25, 2026
What an attacker can do
Two regexes in backend/open_webui/utils/middleware.py parse <$skillId|label> mentions. SKILL_MENTION_RE is <\$([^|>]+)\|?[^>]*> and the strip pattern is <\$[^|>]+\|?([^>]*)>. Because [^|>] is a subset of [^>], the two quantifiers overlap. On input that never closes with >, the engine tries every split point, which costs O(n²) time.
Both run synchronously inside the async process_chat_payload coroutine on every chat completion. No skill has to exist and no setting has to be on. With the default UVICORN_WORKERS=1 in backend/start.sh, a blocked event loop stops the API and UI for all users until the worker is killed.
Any logged-in user can trigger it with a single message. It can also fire by accident when retrieved content, such as a RAG chunk or tool output, contains the pattern. The strip pattern added in 0.9.6 is far worse: a 64k blob takes about 6 seconds and a roughly 96 KB one takes minutes. On 0.9.2 to 0.9.5 an input of hundreds of KB is needed. Impact is availability only (CVSS 6.5).
Who is affected
The open-webui pip package, versions >= 0.9.2, < 0.10.0. The extract regex has been quadratic since 0.9.2. Version 0.9.6 added the second, much slower regex, so a small input is enough to hang it. Multi-worker deployments are hurt less, but each worker can still be pinned.
pip show open-webuiFor Docker, check the image tag.
open-webui
- Ecosystem
- PyPI
- Affected
- >= 0.9.2, < 0.10.0
- Fixed in
- 0.10.0
- Check
pip show open-webui
How to fix it
Upgrade to open-webui 0.10.0.
pip install --upgrade open-webui==0.10.0The patch makes the optional |label a non-capturing optional group, so the quantifiers no longer overlap: <\$([^|>]+)(?:\|[^>]*)?> and <\$[^|>]+(?:\|([^>]*))?>. Matches on well-formed mentions are unchanged, and the hostile input then returns in under 1 ms. The advisory lists no workaround. If you cannot upgrade, running several uvicorn workers softens the effect.
How to tell if you were hit
Signs are a worker stuck at 100% CPU inside Python's re module, chat requests that never return, and the UI and API timing out for all users at once. Check the request log for the chat completion call that started the stall, and look for messages or retrieved content containing <$ followed by thousands of characters without >. A restart clears the stall until the same content is processed again.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
Two regexes in backend/open_webui/utils/middleware.py that parse <$skillId|label> skill-mention tags backtrack in O(n²) on input that contains <$ followed by a long run with no closing >. Both run synchronously, on the asyncio event loop, on every chat completion with no feature gate. Because the default deployment is a single uvicorn worker, one such input pins a CPU core inside re and freezes the entire instance for all users until the worker is killed. Any authenticated user can trigger it with one chat message; it also fires accidentally on benign retrieved content (a RAG chunk or tool output) containing the pattern.
Affected versions
>= 0.9.2, < 0.10.0. Fixed in v0.10.0 (there is no 0.9.7 release).
SKILL_MENTION_RE(the extract pattern) has been O(n²) since v0.9.2; exploitable on 0.9.2–0.9.5 with a large input (hundreds of KB).- v0.9.6 added a second, far more aggressive O(n²) in the strip pattern (introduced by the "keep label as readable text" change), so on 0.9.6 a small input is enough to hang the instance.
Both are fixed by the same patch.
Affected component
backend/open_webui/utils/middleware.py (line numbers as of v0.9.6):
# line 2223 — used by extract_skill_ids_from_messages(), called unconditionally (~line 2625)
SKILL_MENTION_RE = re.compile(r'<\$([^|>]+)\|?[^>]*>')
# line 2247 — used by strip_skill_mentions(), called unconditionally (line 2662)
strip_re = re.compile(r'<\$[^|>]+\|?([^>]*)>')extract_skill_ids_from_messages() runs before the if all_skill_ids: block (that guard gates only skill *injection*, not the regex), and strip_skill_mentions() runs with no guard at all. Neither requires a skill to exist or any setting to be enabled. Both functions are plain synchronous calls inside the async process_chat_payload coroutine, so they block the event loop; with the default UVICORN_WORKERS=1 (backend/start.sh) the whole instance stalls.
Root cause
[^|>] is a subset of [^>], so the quantifier pair [^|>]+ \|? [^>]* is ambiguous: on input that never closes with >, [^|>]+ greedily consumes the tail, > fails, and the engine backtracks through every split point between [^|>]+ and [^>]* — O(n) positions each doing O(n) work. Polynomial, not exponential, but more than enough to hang a single worker on a ~100 KB input.
Proof of concept
Standalone (no Open WebUI required):
import re, time
EXTRACT = re.compile(r'<\$([^|>]+)\|?[^>]*>')
STRIP = re.compile(r'<\$[^|>]+\|?([^>]*)>')
for n in (8_000, 16_000, 32_000, 64_000):
s = '<$' + ('a' * n)
for name, rx in (('extract', EXTRACT), ('strip', STRIP)):
t = time.perf_counter(); rx.search(s)
print(f'n={n:>6} {name:>7} = {(time.perf_counter()-t)*1000:8.1f} ms')Time quadruples per doubling of n (textbook O(n²)); the strip pattern runs for ~6 seconds on a 64k blob and for minutes on a ~96 KB one.
End-to-end against a live instance (default config):
docker run ghcr.io/open-webui/open-webui:v0.9.6on defaults.- Log in as any user (no admin or skill setup).
- Send a chat message containing
<$followed by 50k+ characters with no>. - One CPU core pegs in
re; UI and API stop responding for every user until the worker is killed.
Patch
Rewrite the optional |label as a non-capturing optional group so the two quantifiers no longer overlap. Both patterns become linear; captures and substituted output are unchanged on well-formed <$id|label>, <$id|>, and bare <$id> mentions.
SKILL_MENTION_RE = re.compile(r'<\$([^|>]+)(?:\|[^>]*)?>')
strip_re = re.compile(r'<\$[^|>]+(?:\|([^>]*))?>')After the patch the same hostile input returns in under 1 ms. Shipped in v0.10.0.
Credit
Reported by @Vlad-WKG, including a correct root-cause analysis and patch.
Credited to Vlad-WKG, Classic298.
Questions
- Is there an Open WebUI 0.9.7 with the fix?
No. The advisory says there is no 0.9.7 release. The fix ships in 0.10.0.
- Does the attacker need special permissions?
No admin rights or skills setup. Any authenticated user can send the message. The advisory also notes that benign retrieved content with the pattern can trigger it.
- Is 0.9.6 worse than older affected versions?
Yes. It added a second quadratic regex. A small input hangs it, while 0.9.2 to 0.9.5 need hundreds of KB.
- Can it lead to code execution or data theft?
No. The CVSS vector shows only high availability impact. It is a denial of service.
References
Read for this analysis:
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More Open WebUI vulnerabilities
All Open WebUI entriesCVE-2026-87011
Open WebUI: Unauthenticated requests can stall the server via uncached OIDC fetches in back-channel logout
high7.5Sep 10, 2026CVE-2026-87012
Open WebUI: Any authenticated user can suppress calendar alerts instance-wide via a non-numeric alert value
medium4.3Sep 10, 2026CVE-2026-87013
Open WebUI: Any authenticated user can start a non-terminating request via a folder parent cycle
medium4.3Sep 10, 2026CVE-2026-87014
Open WebUI: Admin demoted through SSO role sync keeps read and write access to all users' notes
medium6.5Sep 10, 2026CVE-2026-87015
Open WebUI: A user's session cookies are sent to tool servers configured for bearer authentication
medium6.8Sep 10, 2026CVE-2026-87016
Open WebUI: Sign-in as another user via wildcard characters in the OAuth subject claim on SQLite
high8.1Sep 10, 2026
