Some web apps convert Markdown written by users, such as inquiry messages, internal bulletin boards or ticket comments, into HTML on the server for display. Mistune is one of the Python libraries that can be used for this, and nbconvert, which converts Jupyter notebooks into HTML and other formats, also depends on it. Two issues have been found in Mistune where a single input of a few dozen KB stalls conversion for tens of seconds.
On November 19, 2026, two Mistune issues (GHSA-ww7q-mxrj-5ffg / CVE-2026-97699 and GHSA-phmp-hrw4-r36r / CVE-2026-97698, both HIGH) were added to GitHub's advisory database. They had been published in the Mistune repository on October 19, the same day as 3.4.0. Versions below 3.3.4 are affected, and 3.3.4 was released on PyPI on July 22. Based on the advisories and the results of passing the same input to 3.3.3, 3.3.4 and 3.4.0 in our working environment, this article sorts out the steps for upgrading and checking.
What input causes the stall
Both issues are in the processing that parses links and images in Markdown, where time grows in proportion to the square of the input length. No special settings or plugins are needed; they occur with the default conversion (mistune.html()).
- Image syntax (GHSA-ww7q-mxrj-5ffg): input with N repetitions of
![, thenx, then N repetitions of]. For each image opening marker, the rest of the text was searched again from scratch. According to the advisory, a safeguard in the link handling did not apply under the conditions for images. - Empty links (GHSA-phmp-hrw4-r36r): input that simply repeats
[](. For each(after the empty label[], the closing bracket was searched for all the way to the end of the document.
In both cases, if such input is accepted in a field that users who are not logged in can submit, a single request can use up a worker. The advisory says, 'A single unauthenticated request pins a worker at 100% CPU.' If several are sent at the same time, other users' requests may also be kept waiting.
On the same day, October 19, another HIGH issue (GHSA-qp42-r9j6-83g9) was also published in the repository. With input that repeats *a_b, the handling of emphasis markers grows quadratically; versions 3.3.0 to 3.3.3 are affected, and the fix is the same 3.3.4. As of November 24, this issue had not been added to GitHub's advisory database. It may not appear in notifications based on the database, so judge by the version you have installed. We did not measure the processing time for this issue in this article.
Results of passing the same input to 3.3.3 and 3.3.4
On November 23, 2026, in our working container (Linux, 4 vCPU, Python 3.11.18), we installed 3.3.3, 3.3.4 and 3.4.0 from PyPI into separate virtual environments and passed the two input patterns above, at varying sizes, to mistune.html(). We ran each condition three times and show the shortest time.
| Input (size) | 3.3.3 | 3.3.4 | 3.4.0 |
|---|---|---|---|
| Image syntax (about 9 KB) | 0.49 s | 0.02 s | 0.01 s |
| Image syntax (about 36 KB) | 7.7 s | 0.08 s | 0.04 s |
| Image syntax (about 72 KB) | 31.8 s | 0.15 s | 0.09 s |
| Empty links (about 6 KB) | 0.64 s | 0.01 s | 0.06 s |
| Empty links (about 24 KB) | 10.1 s | 0.03 s | 0.12 s |
| Empty links (about 48 KB) | 41.9 s | 0.07 s | 0.27 s |
In 3.3.3, doubling the input roughly quadrupled the time. This is almost the same growth as the advisories' '2x input -> ~3.8x time' (for the image syntax issue; '~3.9x' for the empty link issue). In 3.3.4 and 3.4.0, even 48 to 72 KB finished within 0.3 seconds at the shortest time (the longest of the three runs was 0.39 seconds, for empty links of about 48 KB on 3.4.0).

The results were the same with the setting that does not pass HTML through as is (mistune.create_markdown(); escape=True by default) (one run per condition; another build was running in the same environment during measurement). On 3.3.3, image syntax of about 36 KB took 7.9 seconds, and empty links of about 24 KB took 10.6 seconds. The HTML handling setting is not a workaround for this issue. On the other hand, ordinary text containing emphasis, links and images (about 43 KB) took around 0.04 seconds on every version.
These measurements come from a single working environment and do not indicate the performance of production servers. The editorial team has kept the scripts used for measurement and the full results.
What to check before and after upgrading (editorial suggestion)
- Check the installed version. Even if your app does not use it directly, it may be installed as a dependency of another package. Check the version with
pip show mistuneoruv pip list. For example, nbconvert 7.17.2 requiresmistune<4,>=2.0.3, so older environments may still have 3.3.3 or earlier. - Upgrade to 3.3.4 or later. As of November 24, the latest is 3.4.0 (October 19). According to the changelog, 3.4.0 requires Python 3.10 or later and reworks how links are parsed. The unreleased section of the changelog also mentions a plan to drop support for Python 3.10 in the next version. Because the output may change, use 3.3.4 if you stay on the 3.3 series, and if you move to 3.4.0, compare the conversion results in your own tests before deploying.
- Put a limit on input size. Mistune's documentation (Security model) states that
escape=Trueis not a general-purpose HTML sanitizer and is not a substitute for measures such as application-level request size limits or process isolation. Limiting the length of Markdown accepted through forms and APIs, and setting a time limit on conversion, also helps against other similar problems. - Check whether you use
mistune.html. The same document says thatmistune.htmlis a compatibility parser built onescape=False, and that it must not be used for untrusted input unless the output is passed through a separate HTML sanitizer. If the code that converts user input usesmistune.html(), consider switching tocreate_markdown()along with this update.
Scope of verification
On November 22–23, 2026, we reviewed the JSON for GHSA-ww7q-mxrj-5ffg and GHSA-phmp-hrw4-r36r in github/advisory-database (both published on November 19, 2026), commit b4dd328 and the v3.3.4 tag in lepture/mistune,
docs/changes.rst(3.3.4 and 3.4.0) anddocs/security.rst, the versions and release dates on PyPI, and the dependency declaration of nbconvert 7.17.2 (document research). On November 24, we rechecked the advisory in the lepture/mistune repository (its publication date and GHSA-qp42-r9j6-83g9) and the latest version on PyPI. We also measured the processing time of 3.3.3, 3.3.4 and 3.4.0 in a working container (hands-on testing). We have not tested it embedded in a web application, nor tried to reproduce the issue in nbconvert or Jupyter.
We covered how to keep checking Python dependencies for vulnerabilities in our article on uv audit, and a case where regular expression processing time became a problem in our article on Ruby regular expressions.
GleamHub's development, AI and automation consulting covers maintaining web applications that handle user input and planning dependency updates. Please reach out through our contact form.
References
- GHSA-ww7q-mxrj-5ffg: Mistune: Quadratic-time DoS in inline image parsing (precedence_scan) bypasses not-is-image guards(github/advisory-database)
- GHSA-phmp-hrw4-r36r: Mistune: Quadratic-time DoS in parse_link_href via unbounded parenthesis scan on empty-label links(github/advisory-database)
- GHSA-qp42-r9j6-83g9: Quadratic-time DoS in
_process_emphasis_delimitersindex-fixup loop (lepture/mistune advisory) - lepture/mistune — docs/changes.rst
- lepture/mistune — docs/security.rst(Security model)
- mistune(PyPI)









