CVE-2026-59220

CVE-2026-59220 is a medium-severity inefficient regular expression (ReDoS) vulnerability in open-webui (pip), affecting versions >= 0.9.2, < 0.10.0. It is fixed in 0.10.0.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

Open WebUI: ReDoS in skill-mention regexes causes whole-instance DoS on default config

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):

  1. docker run ghcr.io/open-webui/open-webui:v0.9.6 on defaults.
  2. Log in as any user (no admin or skill setup).
  3. Send a chat message containing <$ followed by 50k+ characters with no >.
  4. One CPU core pegs in re; UI and API stop responding for every user until the worker is killed.

Credit

Reported by @Vlad-WKG, including a correct root-cause analysis and patch.

Impact

A regular expression with worst-case exponential or polynomial matching time is applied to untrusted input, causing excessive CPU use. Typical impact: denial of service when input is crafted to trigger backtracking.

CVE-2026-59220 has a CVSS score of 6.5 (Medium). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (0.10.0); upgrading removes the vulnerable code path.

Affected versions

open-webui (>= 0.9.2, < 0.10.0)

Security releases

open-webui → 0.10.0 (pip)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

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.

Frequently Asked Questions

  1. What is CVE-2026-59220? CVE-2026-59220 is a medium-severity inefficient regular expression (ReDoS) vulnerability in open-webui (pip), affecting versions >= 0.9.2, < 0.10.0. It is fixed in 0.10.0. A regular expression with worst-case exponential or polynomial matching time is applied to untrusted input, causing excessive CPU use.
  2. How severe is CVE-2026-59220? CVE-2026-59220 has a CVSS score of 6.5 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of open-webui are affected by CVE-2026-59220? open-webui (pip) versions >= 0.9.2, < 0.10.0 is affected.
  4. Is there a fix for CVE-2026-59220? Yes. CVE-2026-59220 is fixed in 0.10.0. Upgrade to this version or later.
  5. Is CVE-2026-59220 exploitable, and should I be worried? Whether CVE-2026-59220 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2026-59220 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2026-59220? Upgrade open-webui to 0.10.0 or later.

Other vulnerabilities in open-webui

Stop the waste.
Protect your environment with Kodem.