Abstract
Some denial of service needs no flood. One input of a few kilobytes, chosen to drive an algorithm into its worst case, can hold a processor core for seconds or minutes. Why do these bugs keep appearing in mature code, and what actually stops them? A hash table’s expected constant time assumes keys that are independent of the hash function. A plain backtracking regex engine, when a match fails, may try every way of matching an ambiguous pattern. Parsers accumulate, rescan or re-render a growing structure once per piece of input. In each case the code was designed for the average input, and an attacker chooses the worst one. Defences come in three kinds. Algorithms with deterministic worst-case bounds remove the slow case: tree buckets for orderable keys, automata-based regex engines, single-pass parsers. Keyed hashing with a strong function leaves a table’s mathematical worst case intact but makes colliding keys impractical to choose, provided the key stays secret and well seeded. Limits on permitted work, set on the quantity that actually drives the cost, cap what remains. Fuzzers that search for slowness find these bugs, and timed regression tests catch known slow inputs if they return.
Worst case, chosen by the attacker
The library’s article on denial of service sets this class beside floods and connection exhaustion and summarises its history: Crosby and Wallach’s 2003 paper,1 Klink and Wälde’s December 2011 talk showing that a single HTTP request could hold PHP, ASP.NET or Java servers at 99% CPU “for several minutes to hours”,2 and regex outages such as Cloudflare’s in 2019.3
Complexity analysis gives three different promises, and the attacks exploit the gaps between them. A worst-case bound holds for every input of a given size. An expected bound averages over random choices, either the algorithm’s own random choices or an assumed random distribution of inputs. An amortised bound averages over a sequence of operations on one data structure: a dynamic array that doubles when full copies all its elements now and then, but n appends still cost O(n) in total, so each costs O(1) amortised. Amortised bounds hold for every sequence of operations, and an attacker cannot beat them. Expected bounds that depend on the input distribution give no protection, because an attacker does not draw inputs at random. The complexity article defines running time as a worst-case measure over inputs of a given length. Algorithmic complexity attacks are what happens when code that was tested on average-case inputs meets someone who supplies the worst-case one.
The arithmetic is simple and still surprising. A loop that does one comparison for each unordered pair of n items performs n(n−1)/2 comparisons. At n = 10⁴ that is about 5 × 10⁷; at n = 10⁶ it is about 5 × 10¹¹, ten thousand times more for a hundred times the input. As an illustration only, at an assumed 10⁹ comparisons per second the first takes 0.05 seconds and the second more than eight minutes. A test suite whose inputs stay near the first size can easily miss the problem, while a request carrying a million items reaches the second; how many bytes that takes depends on the format. If the work per step is cubic in a dimension that grows in proportion to the input, doubling the input multiplies the work by eight.
CWE has two entries for the class. CWE-407, “Inefficient Algorithmic Complexity”, describes an algorithm with “an inefficient worst-case computational complexity” that “can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached”, and lists “Quadratic Complexity” as an alternate term.4 CWE-1333 covers the regex case: “a regular expression with a worst-case computational complexity that is inefficient and possibly exponential”.5 Being in a memory-safe language does not help: Crosby and Wallach noted in 2003 that such attacks “can function even against code written in safe languages”,1 and most of the parser cases below are in Python, PHP, JavaScript or Elixir. (The library’s measurement of memory safety covers what those languages do prevent.)
Hash tables
What “expected O(1)” assumes
In the standard analysis of a chained hash table with m buckets and n keys, the expected chain length is n/m, on the assumption that keys hash uniformly and independently. Growing the table to keep n/m bounded gives the familiar expected constant number of chain steps per operation, on top of the cost of hashing and comparing the keys themselves, which grows with key length. The assumption doing the work is that the keys do not depend on the hash function. If the function is public and fixed, an attacker can compute keys that all land in one bucket. Each insertion that checks for duplicates then walks the whole chain, so inserting n keys costs 0 + 1 + … + (n − 1) = n(n − 1)/2 key comparisons. Crosby and Wallach make the same point: when every element hashes to the same bucket, inserting all n elements takes O(n²) time.1
Their measurements on Perl show the scale. After about one CPU hour of precomputation they had 97,000 to 110,000 colliding 24-character strings for each of Perl 5.6.1 and 5.8.0, whose hash functions differ. Inserting 90,000 attack strings into the matching version took 6,506 seconds (5.6.1) and 6,838 seconds (5.8.0), against under 2 seconds for strings built against the other version. At n = 90,000, n(n − 1)/2 is about 4.05 × 10⁹ chain comparisons. The paper’s summary: “One hour of pre-computed CPU work, on the client, can cause almost two hours of online work for a server.”1
Keys, and what the key must withstand
Crosby and Wallach proposed universal hashing: a family of functions indexed by a secret key, such that for any two fixed distinct messages, the probability of a collision over the random choice of function from the family is below a small ε. For a pair of keys fixed in advance, an attacker who does not know the key has only probability ε of a collision. The bound says nothing about an attacker who adapts after observing the table, as the next paragraph shows. They benchmarked a Carter-Wegman dot-product construction and UHASH, and found that swapping UHASH into Perl changed application performance by “plus or minus 10%”.1
In 2012 Aumasson and Bernstein argued that this was not strong enough. Their objection was to linear hashes of the form H(m) = m₀k₀ + m₁k₁ + … with a secret key. An attacker who can measure lookup times can tell when a probe string m′ shares a bucket with a known string m. That gives one equation H(m′) ≡ H(m) modulo the table size, and by linearity, adding multiples of m′ − m to m produces more colliding strings. With enough such equations, Gaussian elimination recovers enough of the key to generate collisions at will. They added that many of the defences proposed after December 2011 “simply add some entropy” to the coefficients of such linear hashes, and “the attack works no matter how k₀, k₁, . . . are chosen”. In implementations that enumerate entries in an order that depends on hash values, the order itself leaks, and the paper notes that applications often expose it to attackers.6
The same paper examined the opt-in hash randomisation that Python 2.7.3 and 3.2.3 introduced in April 2012 behind the -R option, and showed that it leaked its key: “the 128-bit key can be recovered efficiently given only two outputs of the keyed hash.”6 For the 29C3 congress in December 2012, the talk abstract of Aumasson, Bernstein and Martin Boßlet announced “universal multicollision” attacks on MurmurHash and CityHash64 that work whatever the seed, and promised demonstrations against a Ruby on Rails application and OpenJDK 7.7 A random seed does not help when the function’s collisions do not depend on it.
Their answer was SipHash, a pseudorandom function designed for short inputs; the paper reports 140 cycles to process a 16-byte input with a fresh key on an AMD FX-8150.6 The security argument is about what remains for an attacker. If H is a strong PRF, then H mod ℓ is unpredictable even to someone who sees the bucket index of chosen strings. The paper’s model is an attacker who sees the bucket index of chosen strings, a power-of-two bucket count ℓ, and a strong secret function. Brute force still works, but finding n strings that share a bucket takes on average about nℓ guesses; with ℓ on the same scale as n, about n² strings. The paper concludes that the CPU amplification n “is limited to the square root of the volume of attacker communication”, whereas a public or weak hash lets n grow linearly with the traffic.6 That is an expected-work scale under the model, not a deterministic ceiling. Python made SipHash its default string hash in 3.4 under PEP 456.8 Rust’s standard HashMap defaults to a randomly seeded hasher chosen for “resistance against HashDoS attacks”, currently SipHash 1-3. Its documentation also warns that seeds drawn when the system entropy pool is low, “such as during system boot”, may be of lower quality.9 Seeding can also fail through plain bugs. libexpat 2.8.4 (31 August 2026) fixed CVE-2026-76956, an inverted check of the getentropy() return value that “allows for hash flooding denial of services” in configurations where getentropy is the only high-quality entropy source.10
Bounding the bucket instead
The other defence leaves the hash alone and changes what a long chain costs. JEP 180, delivered in Java 8, makes a HashMap bucket switch from a linked list to a balanced tree once it grows past a threshold: “In the case of high hash collisions, this will improve worst-case performance from O(n) to O(log n).” The improvement applies to keys that implement Comparable. The JEP does not treeify Hashtable or WeakHashMap, and reverts Hashtable to its state before the alternative string hashing added earlier in JDK 8.11 In the OpenJDK 8 source, an ordinary put that appends a ninth entry to a bin already holding eight triggers conversion, provided the table has at least 64 buckets; a smaller table is resized instead. When colliding keys have equal hashes and cannot be told apart by compareTo, the tree lookup may have to search both subtrees.12 When comparisons are consistent and distinguish unequal keys with equal hashes, n colliding insertions take O(n log n) comparisons. As a scale illustration, not an implementation count, at n = 90,000 that is roughly 90,000 × 17 ≈ 1.5 × 10⁶ steps, against about 4 × 10⁹ for chains. This defence does not depend on a secret staying secret. Its limit is that keys need a usable ordering. Bernstein’s DNS cache took a cruder version of the same idea years earlier and capped each chain at 100 entries, which works for a cache that can drop data but “is obviously not a general-purpose solution”.6
The hashes nobody keyed
PEP 456 keys the hash of strings and bytes.8 Python’s integers are hashed differently: the language documentation specifies hash(x) for a non-negative integer as x reduced modulo a prime P, exposed as sys.hash_info.modulus, which CPython sets to 2⁶¹ − 1 on 64-bit builds.13 That definition makes integers that differ by a multiple of P collide, with no secret involved.
pyasn1, a Python ASN.1 library, fixed a case of this in CVE-2026-119194 (GHSA-fm9c-5rcf-2q5p; published by the project on 27 October 2026 and in the GitHub Advisory Database on 30 October). When it decodes BER, CER or DER data without a schema, it added each component’s TagSet object to a growing set, although it only needed to know whether there was one distinct tag set or more. A TagSet‘s hash is computed from tuples of tag class and tag number,14 so tag numbers that collide under the integer hash propagate, through the tuple hash, into colliding TagSet hashes. The encoding allows long tag numbers. pyasn1 0.6.4, the version measured, already capped long-form tag IDs at 20 octets (140-bit tag IDs) after CVE-2026-59884,15 and that cap still admits numbers large enough to produce the reported collisions. Each insertion then compares against more earlier entries. The advisory reports that doubling the components from 3,200 to 6,400 raised decode time from 0.438 to 1.747 seconds, a ratio of 3.99, while a control input rose from 0.031 to 0.065 seconds. The fix stops adding to the set once it holds two distinct tag sets.16 The set held library objects, but their hashes were built from attacker-chosen integers, a type whose hash has no key.
Regular expressions
Two ways to run a regex
A regular expression without extensions describes a regular language, and a finite automaton recognises it. Russ Cox’s 2007 article contrasts two ways of running the automaton. Thompson’s 1968 method simulates the nondeterministic automaton by tracking the set of states it could be in after each character. At most every state is active, so each character costs a bounded amount of work, and a pattern of size m runs on text of size n in O(mn) time. “The efficiency comes from tracking the set of reachable states but not which paths were used to reach them.” A backtracking engine instead follows one path at a time and, on failure, goes back to the last choice and tries the next one. When many paths lead to the same place, it explores each.17
Cox’s benchmark is the pattern a?ⁿaⁿ (n optional a’s followed by n required ones) against the string aⁿ. A backtracking engine tries “one” before “zero” for each ?, so it explores 2ⁿ combinations before reaching the only one that works, with every ? matching nothing. Perl needed “over sixty seconds to match a 29-character string”, while a Thompson implementation took twenty microseconds. Extrapolating, a 100-character string would take Perl “over 10¹⁵ years”.17 The arithmetic is checkable: 2²⁹ is about 5.4 × 10⁸ paths.
Counting (a+)+ by hand
The textbook ReDoS pattern is ^(a+)+$ against a run of n a’s followed by one character that is not a. The outer + can group the a’s in any way: one group of n, or n groups of one, or anything between. The number of ways to split n items in a row into non-empty consecutive groups is 2ⁿ⁻¹, because each of the n − 1 gaps between letters either is or is not a group boundary. For n = 4 that is 8: (aaaa), (aaa)(a), (a)(aaa), (aa)(aa), (aa)(a)(a), (a)(aa)(a), (a)(a)(aa), (a)(a)(a)(a). Every split reaches the final character, fails on $, and sends the engine back to try the next. A plain backtracking matcher therefore does work proportional to 2ⁿ⁻¹: 524,288 splits at n = 20 and 536,870,912 at n = 30. Each additional character doubles the time.
Ambiguity: exponential and polynomial
What makes (a+)+ dangerous is ambiguity: one string can be matched in many ways. Weideman, van der Merwe, Berglund and Watson used results on the degree of ambiguity of nondeterministic automata to classify a backtracking matcher’s worst case. An automaton has infinite degree of ambiguity (IDA) when the number of accepting runs grows without bound with input length. That growth is either exponential (EDA) or polynomial. Their ambiguity criteria are stated for a trim NFA without ε-loops, and for matching time they analyse a prioritised automaton that models the backtracking matcher’s order of choices. Exponential matching time requires a state “with at least two loops that can be followed while processing the same substring”, as (a+)+ has. For polynomial matching time, the paper requires pairs of states with loops on each and a path between them, all of which can be followed while reading the same string, and chains of such pairs linked by further paths; d + 1 for the longest chain of d pairs bounds the degree of the polynomial. S*U* is the simplest shape. The number of ways to match and the matcher’s running time are related but separate quantities, and the paper treats them separately. A pattern containing S₁\U₁\S₂\U₂\ “could potentially attempt to match ... in quadratic (in k) different ways, leading to cubic matching time.” In the exponential case, an exploit string has three parts: a prefix that reaches the ambiguous states, a pump repeated k times, and a suffix that forces failure so the engine tries every alternative.18
Their tool’s results on two corpora give a sense of proportion. Of 12,499 Snort and 2,994 RegExLib expressions, a first analysis flagged 156 as EDA and 1,041 as IDA, and skipped or timed out on 4,298. Full analysis classified 122 of the 156 as exponential and 692 of the 1,041 as polynomial, of various degrees, with other cases unresolved. The authors then ran the generated exploit strings for the 122 against the Java matcher, and all but two showed exponential matching time.18 In these classifications, polynomial patterns outnumbered exponential ones by 692 to 122.
Cloudflare’s 2 July 2019 outage illustrates the polynomial kind. It was caused by a WAF rule Cloudflare itself deployed, and the post-mortem records that an attack was dismissed as a possibility. It identifies the critical part of the rule as .*(?:.*=.*), which it simplifies to .*.*=.*, two adjacent loops that can each consume the same characters. Its worked example, illustrated with Perl’s Regexp::Debugger, counts engine steps: 23 to match x=x, 555 when twenty x’s follow the =, and 4,067 to fail on twenty x’s with no =. Adding a literal ; at the end, so that the match fails after all that work, raises the count for x= plus twenty x’s to 5,353. Making the quantifiers lazy (.*?.*?=.*?;) did not change the step counts at all.3 Lazy quantifiers change the order in which a backtracking engine tries the alternatives. A failing match still tries all of them.
The Ruby 3.2 release notes give a second, checkable polynomial case: /^a*b?a*$/ against 50,000 a’s followed by an x took 10 seconds in Ruby 3.1.19 With b? matching nothing, the two a* loops can divide the a’s between them in about 50,000 ways. For each length the first loop takes, the second loop gives back its characters one at a time before $ fails at the x, so by this estimate the work is about n²/2 ≈ 1.25 × 10⁹ steps.
Finding vulnerable patterns statically
Static ReDoS analysis asks two questions: is the pattern ambiguous enough to be slow, and can an attacker’s string reach it? Wüstholz, Olivo, Heule and Dillig’s Rexploiter (arXiv, January 2017) answers both. It classifies a pattern’s automaton as linear, super-linear or exponential and builds an attack automaton that accepts exactly the strings that cause the worst case. A dynamic step then infers a lower bound on the length of an attack string that makes Java’s matcher exceed a user-given time limit. A sanitisation-aware program analysis uses the attack automaton and that length bound to decide whether attacker-controlled input can still reach the pattern in an attacking form after the program’s own checks, such as a length limit. In 150 Java programs from GitHub they report 41 exploitable vulnerabilities “with a 11% false positive rate”.20 Reachability is a separate condition from ambiguity: a slow pattern is a vulnerability only where attacker-controlled input of sufficient length reaches it. Syntax-only screening has the opposite weakness. Davis, Coghlan, Servant and Lee’s 2018 ecosystem study found that the conventional anti-pattern heuristics have “few false negatives but many false positives”.21
What the engines changed
Three families of engine change the worst case itself.
- Automata-only engines. RE2 states that “match time is linear in the length of the input string” and that “as a matter of principle, RE2 does not support constructs for which only backtracking solutions are known to exist”, so backreferences and look-around are missing; Go’s
regexpand Rust’sregex“follow the same principles”.22 Go’s documentation says its implementation “is guaranteed to run in time linear in the size of the input”.23 The Rust crate documents an O(m × n) worst case for a single search (is_match,find,captures), where m counts the regex after counted repetitions are expanded, and says it is meant to search “untrusted haystacks without fear of ReDoS”; iterating over all matches withfind_iterorcaptures_iteris O(m × n²).24 The first cost is expressiveness. Cox notes that with backreferences, “the best known implementations require exponential search algorithms”.17 The second is that the guarantee is linear in the text for a fixed pattern, so pattern size, memory and constant factors still matter when patterns grow. Turoňová and colleagues (USENIX Security 2022) found that bounded repetition such as(ab){100}is “a notable weakness of nonbacktracking matchers”, and generated inputs that significantly increased their running time. The matchers they tested included RE2 and Rust’s regex: on texts of about 50 MB, their generator produced 110 inputs for RE2 and 96 for Rust that took more than 100 seconds.25 That is consistent with linear scaling in the text for a fixed pattern. The cost lies in the pattern-dependent factor and the constants, and for Rust’s documented bound m already includes the expanded repetition. - Opt-in non-backtracking modes in backtracking ecosystems. .NET 7 added
RegexOptions.NonBacktracking, based on Microsoft Research’s Symbolic Regex Matcher work. Stephen Toub’s write-up of May 2022 explains that it builds a DFA lazily and falls back to NFA simulation if the DFA grows too large.26 V8 shipped an experimental linear-time engine in version 8.8, announced on 11 January 2021, behind flags. One flag makes V8 fall back from its backtracking engine to the linear one after a backtrack count (default 50,000), and another enables anlflag for patterns that must always use it. As announced in 2021, the fallback applied only to patterns without backreferences, lookahead or lookbehind, large or deeply nested finite repetitions, or theuandiflags; the eligible set in later versions should be checked against that version.27 - Memoisation inside a backtracking engine. A backtracking matcher that records which (automaton state, input position) pairs it has already tried and failed need not repeat them, which bounds the work by the number of such pairs. The argument requires that what happens from a given state and position does not depend on how the matcher got there; backreferences break that, because earlier captures matter. Davis, Servant and Lee’s IEEE S&P 2021 paper builds a ReDoS defence on this idea. Full memoisation is “sound and compatible, but its space costs are too high”, so they memoise selectively. They report that selective memoisation cuts space costs by an order of magnitude for the median regex in their corpus, and that run-length encoding brings the cost to constant for 90% of the super-linear regexes they evaluated.28 Ruby 3.2 (December 2022) shipped a memoisation-based matcher. On the
/^a*b?a*$/example above, time fell from 10 seconds to 0.003 seconds, and the release notes say “about 90%” of matches in their experiments complete in linear time. They expect a normal match to use at most about ten times the input length in memory.19
None of these covers everything, which is why timeouts remain. Ruby’s memoisation “cannot be applied” to patterns with backreferences, look-around or “a huge fixed number of repetitions”, so Ruby 3.2 also added Regexp.timeout.19 .NET has had regex timeouts for longer. Toub calls a timeout “a stopgap”, and notes that .NET guarantees “at most O(n) work ... between timeout checks”, so the timeout is checked periodically and a match can run past it by up to that much work.26 Python’s re remains a backtracking engine. Python 3.11 added atomic groups (?>...) and possessive quantifiers, which let a pattern’s author forbid backtracking into a sub-match and so remove ambiguity by hand.29
Parsers
Among the advisories cited here, parsers are the largest group, and they share a small number of shapes. In each one, a step that should cost O(1) per input element costs O(size of something that grows), and the code repeats that step once per element.
| Shape | What grows | Example below |
|---|---|---|
| Accumulate by copying | the value built so far | pyasn1 constructed strings, markdown-it smartquotes |
| Rescan from the start | the unconsumed tail or prefix | libexpat big tokens, smalot/pdfparser, MDEx links |
| Search a list per item | a stack or set of pending items | MDEx HTML tags, pyasn1 tag sets |
| Re-render per nesting level | the subtree below each level | MDEx block quotes (cubic) |
ASN.1: one library’s year
ASN.1’s Basic Encoding Rules give an encoder a lot of freedom, which leaves the decoder a lot of cases to handle. ITU-T X.690 lets a constructed value use the indefinite length form, a single octet 0x80, terminated by two zero octets instead of a stated length. It lets bit strings and octet strings be sent as constructed encodings split into segments, applied recursively, and it states that “a segment may be of size zero”. The Canonical Encoding Rules are stricter: a string over 1,000 contents octets is split into primitive fragments, each except the last carrying exactly 1,000 contents octets and the last between 1 and 1,000.30 A BER decoder that accepts every legal encoding therefore has to handle a string sent as a long run of tiny fragments.
The pyasn1 repository lists nine denial-of-service advisories published in 2026; the dates below are the repository’s, and the GitHub Advisory Database lists the July and October ones on 21 July and 30 October.31 On 16 January, CVE-2026-23490 covered memory exhaustion from a RELATIVE-OID with excessive continuation octets.32 On 17 March, CVE-2026-30922 covered unbounded recursion on deeply nested indefinite-length SEQUENCEs.33 Three followed on 9 July, among them CVE-2026-59885, quadratic processing of OBJECT IDENTIFIERs with many arcs, where a crafted payload of tens of kilobytes consumes seconds of CPU per decode() call. That advisory notes that the January fix bounded “the byte length of an individual arc but not the number of arcs”.34 Four more were published on 27 October and fixed in 0.6.5, and Red Hat shipped them for RHEL 8 in RHSA-2026:104949, issued 30 November.35
The constructed-string flaw, CVE-2026-119195 (GHSA-9m75-vc3g-4x39), is the plainest example of accumulation by copying. The decoder appended each fragment with header += component on an immutable bytes value, which copies the whole prefix every time. In the advisory’s words, for N fixed-size fragments “the total copied data grows with 1 + 2 + ... + N, or O(N²).” The same reassembly path serves fourteen string and time types that inherit from the OCTET STRING decoder. The advisory also states which limits did not help: “The decoder’s eight-octet length-field limit and nesting-depth limit do not bound the number of sibling fragments”, and there was “no per-message fragment-count cap”.36 The input grows linearly with N while the copying grows with N², so doubling the number of fragments roughly quadruples the work. The fix in 0.6.5 collects the fragments in a list and joins them once.36
The other two October flaws are the same mistake in different code. Constructed BIT STRING decoding “repeatedly shifts and copies the entire value accumulated so far” (CVE-2026-119196).37 Binary REAL decoding built the mantissa a byte at a time with p <<= 8 on a growing integer and chunk = chunk[1:], which copies the remaining suffix on every step (CVE-2026-119197).38
pyasn1’s year shows two things. First, limits on one dimension of the input (arc length, nesting depth, length-field size) left other dimensions open (arc count, sibling count), and later advisories found them. The October fixes were changes of algorithm rather than new caps: append-and-join for strings, and classification bookkeeping that stops after two distinct tag sets.3616 Second, the advisories state their own reachability conditions. CVE-2026-119195 rates itself 7.5 on the assumption that an application “automatically decodes attacker-supplied ASN.1 from unauthenticated network input”, and adds that “the library finding alone does not establish those conditions”.36
XML: entities and big tokens
Billion-laughs expansion is exponential and well known, and some parsers limit entity nesting or per-entity expansion. The defusedxml documentation describes a variant designed to get past such limits: a quadratic blowup “repeats one large entity with a couple of thousand chars over and over again”. It is less efficient than the exponential attack but “avoids triggering countermeasures of parsers against heavily nested entities”, because “some parsers limit the depth and breadth of a single entity but not the total amount of expanded text throughout an entire XML document”.39 A document of n references to an entity of size s expands to n × s characters; when both n and s grow linearly with the document’s size, the expansion is quadratic in it.
libexpat’s CVE-2023-52425, fixed in 2.6.0 on 6 February 2024, shows the rescan shape in a streaming parser. The change log describes “quadratic runtime issues with big tokens” and notes that applications that parsed a document in a single call were not affected: “The smaller the chunks/buffers you use for parsing previously, the bigger the problem prior to the fix.”40 The pull request gives the mechanism. When a token needs several buffer fills to complete, “expat has to re-parse the token from start multiple times”. A token of length L arriving in chunks of size c is therefore rescanned about L/c times, at an average cost proportional to L/2, which comes to about L²/(2c). The fix is a heuristic that, after repeated failures on the same token, “defers further parsing until there’s significantly more data available”.41
Markdown: pathological tests, and MDEx’s November
Markdown’s inline syntax lets delimiters such as *, [ and backticks go unclosed, and the parser has to decide for each one whether something later closes it, which invites rescanning. The reference C implementation, cmark, treats this as a test obligation. Its README says the suite “includes pathological cases that bring many other Markdown parsers to a crawl (for example, thousands-deep nested bracketed text or block quotes)”.42 Its pathological_tests.py runs each case under a five-second TIMEOUT. The cases include many emphasis openers with no closers, many link closers with no openers, nested brackets, deep block quotes and lists, and a “reference collisions” case that generates 25,000 link labels whose hash, taken modulo a 16-entry reference map, falls in the same bucket.43 The file records past complexity bugs as regression tests with a fixed time limit. The same bugs recur in other implementations: Comrak, a Rust Markdown parser, recorded in GHSA-8hqf-xjwp-p67v (March 2023) that “a range of quadratic parsing issues from cmark/cmark-gfm are also present in Comrak”, fixed in 0.17.0.44
The JavaScript parser markdown-it published several such advisories in 2026; two show the shapes clearly. Its smartquotes rule replaced each straight quote with str.slice(0, index) + ch + str.slice(index + 1), an O(n) copy for every quote in a token of n quotes, which is O(n²) in total (CVE-2026-48988).45 Its linkify handling had two quadratic paths: it rebuilt the token array once per linkified token, and it re-ran a scheme regex over a growing pending buffer at every ://. For the token-array path, triggered by lines of schema-less e-mail addresses, the advisory’s table shows the quadratic signature: 1.1, 4.7, 19.6 and 89 seconds as the input doubles from 5,000 to 40,000 lines.46
MDEx, an Elixir Markdown library, received a batch of CVE records from the Erlang Ecosystem Foundation’s CNA on 30 November 2026, seven of them for quadratic or cubic CPU use.47 The cubic one, CVE-2026-131906, affects MDEx.to_slack/2 from version 0.13.1 through versions before 0.15.0. To render a block quote it renders the whole child subtree to a binary, splits it into lines and rejoins them with a > prefix, “and repeats this at every nesting level”. With quote depth d and m continuation lines, the record gives the cost as proportional to d²·m. It reports about 16 seconds of CPU and 32 MB of output for an input of about 16 KB, while MDEx.to_html!/1 on the same input takes about 1 ms.48 The growth follows from the re-rendering: text at depth k is processed once for each of the k levels above it, and summing k over d levels gives about d²/2 passes over the m lines. When both d and m grow in proportion to the input, doubling the input multiplies the work by eight, as the record says.
The others in the batch are quadratic. In the streaming auto-close link scanner (CVE-2026-129522), after a failed ](, scanning “resumes just after the ], so the next ]( rescans the same tail”; 120 KB took 12.0 seconds.49 In streaming HTML-tag tracking (CVE-2026-134915), each unmatched closing tag scans the whole list of open tags and leaves it unchanged, so 30,000 <div> followed by 30,000 </b> took about 30 seconds.50 All seven sit in streaming, auto-close or conversion code.
PDF: a regular expression built from the input
smalot/pdfparser, a PHP library, published CVE-2026-134129 (GHSA-4w9h-57gf-h3px) on 27 November 2026, fixed in version 2.14.0. To isolate string operands in a page content stream, PDFObject::formatContent() matched from ( to the next ) with a regular expression. When the parentheses did not balance, it rebuilt the pattern with preg_quote() of the attempt so far and searched again from the same offset. Each pass extended the match by one ) while rescanning the growing prefix, so n nested ( followed by n ) took about n passes of O(n) work. The advisory’s measurements on PHP 8.3 show the signature:51
| Nested pairs | PDF size | getText() time |
|---|---|---|
| 1,000 | 2.4 KB | 0.14 s |
| 2,000 | 4.4 KB | 0.48 s |
| 4,000 | 8.5 KB | 2.1 s |
| 8,000 | 16.5 KB | 9.0 s |
Two further details are useful. PDF content streams can be compressed, and the advisory reports that “with FlateDecode compression, a 520-byte PDF takes 6 s”, so a limit on the uploaded file’s size says little about the size the parser sees. And the same construct failed for elements over about 64 KB, where the rebuilt pattern did not compile and “the text of the whole content stream was silently dropped”, which let a crafted PDF hide its text from tools relying on the affected versions for text extraction. The fix replaces every pattern built from the content with one left-to-right scan that tracks parenthesis depth and escapes. Over a test corpus of 320,000 generated content streams, a differential run produced output identical to the previous implementation, the reported exception being inputs that had previously thrown a TypeError.51
Other places the worst case hides
Sorting
Quicksort is O(n log n) on average and O(n²) in the worst case. McIlroy’s 1999 note “A Killer Adversary for Quicksort” shows that pivot-selection heuristics cannot close the gap on their own. His adversary is a comparison function that assigns values only when it has to. All items start as “gas”, values not yet fixed. When two gas items are compared, one is frozen into a definite value, and the adversary guesses which item is the pivot so that the pivot compares low against almost everything. The partitions come out lopsided and the sort goes quadratic. The method works “against any implementation of quicksort–even a randomizing one–that satisfies certain very mild and realistic assumptions”, and running it records the input that causes the quadratic behaviour.52
The fix that held is a hybrid with a fallback whose worst case is guaranteed. Introsort switches to heapsort “if the recursion depth becomes too deep”. Pattern-defeating quicksort (pdqsort) refines when to switch, and Orson Peters proves it O(n log n), because heapsort bounds the cost of the degenerate cases.53 Go 1.19 rewrote its sort package to use pdqsort.54
Number conversion
Some primitive operations are superlinear. CPython’s documentation says its limit applies “when a non-linear conversion algorithm would be involved”, and gives as an example that int('1' * 500_000), if allowed to run, “can take over a second on a fast CPU”; with the default limit in place, that conversion raises ValueError instead. Python’s response to CVE-2020-10735 was an interpreter-wide limit on the number of digits converted, 4,300 by default, enforced with a ValueError. It applies to decimal and every other base that is not a power of two; subinterpreters have their own limit; and it can be configured or disabled by environment variable, command-line option or sys call. Hexadecimal, octal and binary conversions are unlimited because they are linear.13 The documentation marks the feature as added in 3.11, and it was also backported, for example to 3.10.7.55 Any parser that passes numeric text from its input to int() inherits this cost without seeing it, which is an argument for putting the limit in the runtime, where every covered conversion gets it while the limit is enabled.
Space instead of time
Decompression bombs exhaust space instead of time, and they show how output size can grow faster than input size. David Fifield’s 2019 “A better zip bomb” overlaps files inside the zip container so that the output “increases quadratically in the input size”, reaching “a compression ratio of over 28 million” (10 MB to 281 TB) in a single round of decompression with no nested archives.56 A limit on compressed size does not bound this, and neither does a limit on nesting depth. A limit on total output written does.
Finding them
Fuzzing for slowness
Coverage-guided fuzzers look for new code paths. Complexity bugs often lie on paths the fuzzer already covers, and need an input that runs those paths many more times. Two research tools change what the fuzzer optimises. SlowFuzz (Petsios, Zhao, Keromytis and Jana, CCS 2017) uses “resource-usage-guided evolutionary search” to find inputs that maximise instruction counts. It produced inputs that slowed bzip2 decompression 300-fold, regexes with exponential matching times, and many collisions in PHP’s hash table.57 PerfFuzz (Lemieux, Padhye, Sen and Song, ISSTA 2018) maximises the execution count of every program location separately instead of one total. Their motivating example is a word-frequency tool whose hash chains make it quadratic. The first few collisions can reduce total path length, so a fuzzer that only accepts increases in total work never finds the input that makes the chains long. On four C programs they report inputs that execute the most-hit branch “5× to 69× times more” than prior work, and total paths 1.9 to 24.7 times longer.58
Production fuzzing services treat slowness as a bug, with caveats. libFuzzer’s default per-input timeout is 1,200 seconds.59 OSS-Fuzz’s filing rule is per input: an input that takes “more than ~25 seconds” is reported as a timeout bug, and acknowledges that this “may or may not be considered as a real bug by the project owners”. It files only one timeout per fuzz target at a time, because it has no good way to deduplicate them.60 A 25-second threshold catches exponential cases and severe quadratic ones on large inputs. Fuzz inputs are usually small, though. Extrapolating a purely quadratic loop, one that costs 0.2 seconds on a 4 KB fuzz input costs about 13 minutes on a 256 KB request, 64 times larger and so 4,096 times slower. Measuring how the run time grows as input size doubles is the more sensitive test; several of the advisories above report such doubling series (pyasn1’s tag sets, markdown-it’s linkify, smalot), while others give a single measurement.
Static analysis and review
The advisories above suggest review heuristics that a reviewer can apply quickly:
- Accumulation into an immutable value inside a loop.
bytes +=,str +=outside the cases a runtime optimises,chunk = chunk[1:], building a big integer one byte at a time. Use a list or buffer and join once, or amemoryviewand an index. - A search over a growing collection, once per input item.
x in list,list.index,Enum.filterover all pending items,split_whileover a stack. Use a set, a map or a counter, and make sure unmatched items do not leave the structure unchanged so that every later item scans it again. - Restarting a scan at a fixed point after a failure. Resuming “just after the
]“ or “from the same offset” means the next attempt covers the same ground. Record how far the failed scan got. - Re-rendering or re-serialising a subtree at each level of nesting. The cost grows with both the depth and the size of the subtree below each level, as in MDEx’s d²·m case.
- Regular expressions built from input, or applied repeatedly to a growing buffer.
- Hash tables keyed by attacker-chosen values of a type whose hash is not keyed, such as integers, tuples of integers or custom objects.
- A limit on one dimension next to an unbounded one. Length per item versus number of items, depth versus breadth, compressed size versus expanded size.
What works, and what it costs
Choose the algorithm by its worst case
The fixes that ended a bug class did so by changing the bound: linear-time regex engines, tree-backed hash buckets for keys with a usable ordering, introsort and pdqsort, single-pass scanners like smalot’s. RE2-style engines give up backreferences and look-around, and RE2’s own README calls this “pessimistic”: a backtracking engine is fast when the first alternative usually matches.22 Java’s trees give the logarithmic bound only for keys whose comparisons distinguish unequal keys with equal hashes, and add per-bucket overhead.11 Hybrids keep the fast path and switch to a guaranteed algorithm when work exceeds a budget, as pdqsort’s heapsort does for every input.53 V8’s backtrack-count fallback works the same way, but only for patterns its linear engine supports, a set that in the 2021 announcement excluded backreferences and look-around among others. For patterns outside the documented set there is no guarantee, and a timeout or work budget is still needed.27
Keyed hashing, and how it fails
Keyed hashing with a strong PRF does not change a table’s worst case. Under Aumasson and Bernstein’s model (a strong secret function with a protected key, an attacker who sees bucket indices, a bucket count on the scale of the colliding set), the attacker’s expected communication grows with the square of the amplification achieved; that is an expected scale, not a hard ceiling.6 It fails in three ways seen above: a weak function whose collisions do not depend on the seed,7 a seed that is weak or mishandled,910 and key types the language never keyed.1316 Where the key type is controlled by input, the robust options are to hash a canonical byte representation with the keyed function or to use a structure whose worst case does not depend on the hash.
Limits on the right quantity
Limits are the cheapest defence and the easiest to get wrong. pyasn1 had limits on arc length, length-field size and nesting depth, and the next advisories used arc count and sibling count.3436 defusedxml describes parsers that limited each entity’s depth and breadth but not the total expanded text.39 smalot’s 520-byte compressed PDF would pass any upload limit that admits a 520-byte file.51 The rule from these cases is to limit the quantity that the cost grows with, which requires knowing the algorithm’s complexity in terms of each input dimension. Limits also have a cost for legitimate users. Python’s 4,300-digit default can be raised, disabled or worked around with power-of-two bases, so programs that need larger numbers have options, but each has to take one deliberately.13 A limit that is too strict turns into a bug report from users with large but legitimate inputs, so limits work best where the format or protocol already implies a bound.
Budgets, timeouts and isolation
A per-operation work budget turns an unknown worst case into a known one. .NET’s regex timeout is checked periodically, with at most O(n) work between checks, so it bounds the overrun as well as the run,26 and Ruby’s Regexp.timeout covers the patterns its memoisation cannot.19 Timeouts have weaknesses. The check has to sit inside the loop that does the work, as in .NET’s regex engine; a deadline on the surrounding request only helps if something enforces it on the busy code. And an attacker can still send enough requests to keep every worker busy until its timeout expires, so a timeout limits the cost per request and leaves the total to rate limits and capacity. Isolation (a separate process, a cgroup CPU quota, a bounded worker pool for parsing untrusted documents) protects the rest of the service but does not make the parsing work any cheaper. Cloudflare’s post-mortem shows both halves: the outage needed a CPU safeguard that had been “removed by mistake during a refactoring”, and the remediation list included performance profiling for every rule in the test suite as well as moving to engines “which both have run-time guarantees”.3
Is it a vulnerability?
Scores for availability-only bugs depend on choices that are visible in the vectors. The same CNA, on the same day, scored MDEx’s cubic block-quote flaw at 6.9 and the quadratic link-scanner flaw at 2.1, both under CVSS 4.0 and both with local attack vector. The block-quote vector has no attack requirements and high availability impact; the link-scanner vector has attack requirements present and low availability impact.4849 smalot’s advisory uses CVSS 3.1 7.5 with only availability impact,51 and pyasn1’s 7.5 explicitly depends on assumptions about the application calling it.36 curl’s maintainer Daniel Stenberg described in March 2022 why he declined to classify an MQTT busy-loop as a vulnerability. He argued that labelling a bug a security vulnerability when it is not hurts users and the wider community, and that the only applications seriously affected “are the ones that already allow an endless transfer”.61 The library’s guide to reading security advisories covers the general problem of library-level scores. For this class the deployment test is concrete: who can get input to the affected path, with what privileges and after what authentication; how much CPU each byte of that input buys, measured; and whether the deployment bounds the result through limits, budgets or isolation. Remediation priority follows from measured impact and that exposure. A library cannot answer the first and third questions for its users, which is why pyasn1 publishes its assumptions.
A practitioner’s checklist
- List every place that parses or matches input from outside the trust boundary, including conversions to other output formats and streaming modes, which is where MDEx’s flaws were.
- For each, write the cost as a function of every input dimension: total size, item count, nesting depth, token length, number of repetitions, expanded size after decompression or entity expansion.
- Prefer components with documented worst-case bounds: RE2, Go
regexp, Rustregex, .NETNonBacktrackingfor regexes that need no backtracking-only features; keyed hashes, or tree buckets where keys have a usable ordering, for maps keyed by input. Where the deployed engine, in its version, API and mode, documents no bound for a pattern (backreferences are the usual case), give it a timeout or work budget. - Put limits on the dimensions the cost grows with, after decompression and decoding, and test that the limits are enforced.
- Run fuzzers in a mode that rewards slowness (SlowFuzz- or PerfFuzz-style feedback), and keep per-input timeouts tight enough to notice quadratic growth at the fuzzer’s input sizes.
- Keep two kinds of test. Fixed pathological inputs with a time limit, as in cmark’s suite, catch known slow inputs if they return. Growth tests run each parser on generated inputs at n and 2n and compare; before making them block a build, reduce timing noise by repeating runs and taking the minimum or median, using an idle machine, or counting operations instead of wall-clock time.
- Put a work budget or timeout on any remaining superlinear operation, and run untrusted parsing in a pool with bounded concurrency so that the worst case uses up that pool and leaves the rest of the service running.
- When fixing one complexity bug, search for the same pattern elsewhere in the codebase.
Conclusion
Algorithmic complexity attacks keep appearing because code is designed and tested against typical inputs, while attackers supply the worst case. The theory needed to explain them is small. Expected-time bounds assume keys independent of the hash. When a match fails, an ambiguous pattern can make a plain backtracking matcher explore every way of matching. A step repeated once per input item is quadratic when both the number of repetitions and the work per repetition grow in proportion to the input; work repeated over a subtree at every level of nesting costs in proportion to both depth and subtree size, as MDEx’s d²·m shows. The cases since 2023 add little new theory. Libraries in memory-safe languages copied, rescanned and re-rendered growing values, and limits were placed on one dimension while the cost depended on another. The defences differ in kind. Bounded data structures, linear-time regex engines and single-pass parsers change the worst case deterministically. Keyed strong hashes leave the worst case in place but make it impractical to reach while the key stays secret. Limits, budgets and timeouts cap permitted work where neither applies, including the regex features that only backtracking supports. Detection has improved: fuzzers can search for slowness, static tools can relate ambiguous patterns to reachable input, and timed regression tests catch known slow inputs if they return. Whether each such bug deserves a high severity score remains disputed. Whether it deserves a fix does not, because a bug that is minor in one deployment can take down another that passes untrusted input straight to the slow code.
Footnotes
- Scott A. Crosby and Dan S. Wallach, “Denial of Service via Algorithmic Complexity Attacks”, 12th USENIX Security Symposium, August 2003. https://www.usenix.org/legacy/events/sec03/tech/full_papers/crosby/crosby.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5
- Alexander Klink and Julian Wälde, “Effective Denial of Service attacks against web application platforms”, 28C3 talk abstract, Chaos Communication Congress, 28 December 2011. https://fahrplan.events.ccc.de/congress/2011/Fahrplan/events/4680.en.html (opens in a new tab) ↩
- John Graham-Cumming, “Details of the Cloudflare outage on July 2, 2019”, Cloudflare blog, 12 July 2019. https://blog.cloudflare.com/details-of-the-cloudflare-outage-on-july-2-2019/ (opens in a new tab) ↩1 ↩2 ↩3
- CWE-407: Inefficient Algorithmic Complexity, MITRE, accessed 1 December 2026. https://cwe.mitre.org/data/definitions/407.html (opens in a new tab) ↩
- CWE-1333: Inefficient Regular Expression Complexity, MITRE, accessed 1 December 2026. https://cwe.mitre.org/data/definitions/1333.html (opens in a new tab) ↩
- Jean-Philippe Aumasson and Daniel J. Bernstein, “SipHash: a fast short-input PRF”, paper dated 18 September 2012 (Section 7 on hash flooding). https://www.aumasson.jp/siphash/siphash.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6
- Jean-Philippe Aumasson, Daniel J. Bernstein and Martin Boßlet, “Hash-flooding DoS reloaded: attacks and defenses”, 29C3 talk abstract, Chaos Communication Congress, 29 December 2012. https://fahrplan.events.ccc.de/congress/2012/Fahrplan/events/5152.en.html (opens in a new tab) ↩1 ↩2
- Christian Heimes, PEP 456: Secure and interchangeable hash algorithm, Python Software Foundation. https://peps.python.org/pep-0456/ (opens in a new tab) ↩1 ↩2
- HashMap in std::collections, Rust standard library documentation (1.100.1), accessed 1 December 2026. https://doc.rust-lang.org/std/collections/struct.HashMap.html (opens in a new tab) ↩1 ↩2
- libexpat change log at tag R_2_8_4, release 2.8.4 of 31 August 2026, entry for CVE-2026-76956, GitHub. https://raw.githubusercontent.com/libexpat/libexpat/R_2_8_4/expat/Changes (opens in a new tab) ↩1 ↩2
- Mike Duigou, JEP 180: Handle Frequent HashMap Collisions with Balanced Trees, OpenJDK, delivered in JDK 8. https://openjdk.org/jeps/180 (opens in a new tab) ↩1 ↩2
- java.util.HashMap source, OpenJDK 8 (8u91 copy on cr.openjdk.org): TREEIFY_THRESHOLD, MIN_TREEIFY_CAPACITY and TreeNode.find. https://cr.openjdk.org/~andrew/aarch64-8/u91-upstream/jdk/src/share/classes/java/util/HashMap.java.html (opens in a new tab) ↩
- Built-in Types (sections “Hashing of numeric types” and “Integer string conversion length limitation”), Python 3 documentation, accessed 1 December 2026. https://docs.python.org/3/library/stdtypes.html (opens in a new tab) ↩1 ↩2 ↩3 ↩4
- pyasn1 v0.6.4 source, pyasn1/type/tag.py (Tag and TagSet hashing), GitHub. https://github.com/pyasn1/pyasn1/blob/v0.6.4/pyasn1/type/tag.py (opens in a new tab) ↩
- GHSA-m4p7-r5rc-7g4j / CVE-2026-59884, “pyasn1 BER/CER/DER decoder denial of service via unbounded long-form tag IDs”, published by the pyasn1 project 9 July 2026, GitHub Advisory Database 21 July 2026. https://github.com/advisories/GHSA-m4p7-r5rc-7g4j (opens in a new tab) ↩
- GHSA-fm9c-5rcf-2q5p / CVE-2026-119194, “pyasn1 has quadratic CPU use in schemaless BER/CER/DER container decoding”, published by the pyasn1 project 27 October 2026, GitHub Advisory Database 30 October 2026. https://github.com/advisories/GHSA-fm9c-5rcf-2q5p (opens in a new tab) ↩1 ↩2 ↩3
- Russ Cox, “Regular Expression Matching Can Be Simple And Fast (but is slow in Java, Perl, PHP, Python, Ruby, ...)”, January 2007. https://swtch.com/~rsc/regexp/regexp1.html (opens in a new tab) ↩1 ↩2 ↩3
- Nicolaas Weideman, Brink van der Merwe, Martin Berglund and Bruce Watson, “Analyzing Matching Time Behavior of Backtracking Regular Expression Matchers by Using Ambiguity of NFA”, 2016 (copy hosted at King’s College London). https://cflmark.nms.kcl.ac.uk/hg/lexing/raw-file/tip/Literature/catastrophic-backtracking.pdf (opens in a new tab) ↩1 ↩2
- “Ruby 3.2.0 Released”, ruby-lang.org, 25 December 2022. https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/ (opens in a new tab) ↩1 ↩2 ↩3 ↩4
- Valentin Wüstholz, Oswaldo Olivo, Marijn J. H. Heule and Isil Dillig, “Static Detection of DoS Vulnerabilities in Programs that use Regular Expressions (Extended Version)”, arXiv:1701.04045, 15 January 2017. https://arxiv.org/abs/1701.04045 (opens in a new tab) ↩
- James C. Davis, Christy A. Coghlan, Francisco Servant and Dongyoon Lee, “The Impact of Regular Expression Denial of Service (ReDoS) in Practice: An Empirical Study at the Ecosystem Scale”, ESEC/FSE 2018 (NSF public access copy). https://par.nsf.gov/servlets/purl/10105720 (opens in a new tab) ↩
- RE2 README, Google, GitHub, accessed 1 December 2026. https://github.com/google/re2 (opens in a new tab) ↩1 ↩2
- Package regexp, Go standard library documentation, accessed 1 December 2026. https://pkg.go.dev/regexp (opens in a new tab) ↩
- Crate regex (1.13.2), “Untrusted input”, docs.rs, accessed 1 December 2026. https://docs.rs/regex/latest/regex/ (opens in a new tab) ↩
- Lenka Turoňová, Lukáš Holík, Ivan Homoliak, Ondřej Lengál, Margus Veanes and Tomáš Vojnar, “Counting in Regexes Considered Harmful: Exposing ReDoS Vulnerability of Nonbacktracking Matchers”, 31st USENIX Security Symposium, 2022, section 6.3. https://www.usenix.org/system/files/sec22-turonova.pdf (opens in a new tab) ↩
- Stephen Toub, “Regular Expression Improvements in .NET 7”, .NET Blog, Microsoft, 12 May 2022. https://devblogs.microsoft.com/dotnet/regular-expression-improvements-in-dotnet-7/ (opens in a new tab) ↩1 ↩2 ↩3
- “An additional non-backtracking RegExp engine”, V8 blog, 11 January 2021. https://v8.dev/blog/non-backtracking-regexp (opens in a new tab) ↩1 ↩2
- James C. Davis, Francisco Servant and Dongyoon Lee, “Using Selective Memoization to Defeat Regular Expression Denial of Service (ReDoS)”, 2021 IEEE Symposium on Security and Privacy (venue per Stony Brook University research record; PDF from the authors). https://www3.cs.stonybrook.edu/~dongyoon/papers/SP-21-Memoization.pdf (opens in a new tab) ↩
- What’s New In Python 3.11 (re module), Python documentation. https://docs.python.org/3/whatsnew/3.11.html (opens in a new tab) ↩
- ITU-T Recommendation X.690 (02/2021), ASN.1 encoding rules: Specification of BER, CER and DER, sections 8.1.3.6, 8.6.4, 8.7.3 and 9.2. https://www.itu.int/rec/T-REC-X.690-202102-I/en (opens in a new tab) ↩
- pyasn1 security advisories (repository index), GitHub, accessed 1 December 2026. https://github.com/pyasn1/pyasn1/security/advisories (opens in a new tab) ↩
- GHSA-63vm-454h-vhhq / CVE-2026-23490, “pyasn1 has a DoS vulnerability in decoder”, GitHub Advisory Database, 16 January 2026. https://github.com/advisories/GHSA-63vm-454h-vhhq (opens in a new tab) ↩
- GHSA-jr27-m4p2-rc6r / CVE-2026-30922, “Denial of Service in pyasn1 via Unbounded Recursion”, GitHub Advisory Database, 17 March 2026. https://github.com/advisories/GHSA-jr27-m4p2-rc6r (opens in a new tab) ↩
- GHSA-8ppf-4f7h-5ppj / CVE-2026-59885, “pyasn1: Quadratic complexity in OBJECT IDENTIFIER and RELATIVE-OID processing allows denial of service”, published by the pyasn1 project 9 July 2026, GitHub Advisory Database 21 July 2026. https://github.com/advisories/GHSA-8ppf-4f7h-5ppj (opens in a new tab) ↩1 ↩2
- RHSA-2026:104949, “Important: python-pyasn1 security update”, Red Hat, issued 30 November 2026. https://access.redhat.com/errata/RHSA-2026:104949 (opens in a new tab) ↩
- GHSA-9m75-vc3g-4x39 / CVE-2026-119195, “pyasn1 has quadratic-time denial of service in constructed string and indefinite-length ANY decoding”, published by the pyasn1 project 27 October 2026, GitHub Advisory Database 30 October 2026. https://github.com/advisories/GHSA-9m75-vc3g-4x39 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6
- GHSA-2qm8-x737-gmw5 / CVE-2026-119196, “pyasn1 has quadratic CPU consumption in constructed BIT STRING decoding”, published by the pyasn1 project 27 October 2026, GitHub Advisory Database 30 October 2026. https://github.com/advisories/GHSA-2qm8-x737-gmw5 (opens in a new tab) ↩
- GHSA-mm57-4v3p-rchx / CVE-2026-119197, “pyasn1 has quadratic-complexity denial of service in binary REAL decoding”, published by the pyasn1 project 27 October 2026, GitHub Advisory Database 30 October 2026. https://github.com/advisories/GHSA-mm57-4v3p-rchx (opens in a new tab) ↩
- Christian Heimes, defusedxml README, “quadratic blowup entity expansion”, GitHub, accessed 1 December 2026. https://github.com/tiran/defusedxml (opens in a new tab) ↩1 ↩2
- libexpat change log at tag R_2_6_0, release 2.6.0 of 6 February 2024, GitHub. https://raw.githubusercontent.com/libexpat/libexpat/R_2_6_0/expat/Changes (opens in a new tab) ↩
- libexpat pull request #789, “[CVE-2023-52425] Speed up parsing of big tokens”, merged 30 January 2024. https://github.com/libexpat/libexpat/pull/789 (opens in a new tab) ↩
- cmark README, CommonMark, GitHub, accessed 1 December 2026. https://github.com/commonmark/cmark (opens in a new tab) ↩
- cmark test/pathological_tests.py, CommonMark, GitHub, accessed 1 December 2026. https://raw.githubusercontent.com/commonmark/cmark/master/test/pathological_tests.py (opens in a new tab) ↩
- GHSA-8hqf-xjwp-p67v / CVE-2023-28626, “Comrak vulnerable to quadratic runtime issues when parsing Markdown (GHSL-2023-047)”, GitHub Advisory Database, 28 March 2023. https://github.com/advisories/GHSA-8hqf-xjwp-p67v (opens in a new tab) ↩
- GHSA-6v5v-wf23-fmfq / CVE-2026-48988, “markdown-it: Quadratic complexity DoS in smartquotes rule via replaceAt string operations”, published by the maintainers 23 May 2026, GitHub Advisory Database 15 June 2026. https://github.com/advisories/GHSA-6v5v-wf23-fmfq (opens in a new tab) ↩
- GHSA-253c-mchw-3w2r, “markdown-it linkify: true has two quadratic paths, so a few hundred KB of markdown blocks the event loop for tens of seconds”, published by the maintainers 27 August 2026, GitHub Advisory Database 29 September 2026. https://github.com/advisories/GHSA-253c-mchw-3w2r (opens in a new tab) ↩
- CVE index, Erlang Ecosystem Foundation CNA, accessed 1 December 2026. https://cna.erlef.org/cves/ (opens in a new tab) ↩
- CVE-2026-131906, “Cubic-time nested block quote rendering in MDEx to_slack enables CPU denial of service”, Erlang Ecosystem Foundation CNA, 30 November 2026. https://cna.erlef.org/cves/CVE-2026-131906.html (opens in a new tab) ↩1 ↩2
- CVE-2026-129522, “Quadratic rescanning in MDEx auto-close link scanner allows CPU denial of service”, Erlang Ecosystem Foundation CNA, 30 November 2026. https://cna.erlef.org/cves/CVE-2026-129522.html (opens in a new tab) ↩1 ↩2
- EEF-CVE-2026-134915 / CVE-2026-134915, “Quadratic HTML tag tracking in MDEx.stream/2 allows CPU exhaustion via unmatched closing tags”, OSV, 30 November 2026. https://osv.dev/vulnerability/EEF-CVE-2026-134915 (opens in a new tab) ↩
- GHSA-4w9h-57gf-h3px / CVE-2026-134129, “Quadratic-time denial of service in PDFObject::formatContent()”, smalot/pdfparser security advisory, GitHub, 27 November 2026. https://github.com/smalot/pdfparser/security/advisories/GHSA-4w9h-57gf-h3px (opens in a new tab) ↩1 ↩2 ↩3 ↩4
- M. D. McIlroy, “A Killer Adversary for Quicksort”, Software—Practice and Experience, vol. 29, 1999 (author’s copy). https://www.cs.dartmouth.edu/~doug/mdmspe.pdf (opens in a new tab) ↩
- Orson R. L. Peters, “Pattern-defeating Quicksort”, arXiv:2106.05123, 9 June 2021. https://arxiv.org/abs/2106.05123 (opens in a new tab) ↩1 ↩2
- Go 1.19 Release Notes (sort), The Go Project. https://go.dev/doc/go1.19 (opens in a new tab) ↩
- Python 3.10.7 changelog (gh-95778, CVE-2020-10735), Python documentation. https://docs.python.org/release/3.10.7/whatsnew/changelog.html (opens in a new tab) ↩
- David Fifield, “A better zip bomb”, 2 July 2019 (updated to 18 May 2023). https://www.bamsoftware.com/hacks/zipbomb/ (opens in a new tab) ↩
- Theofilos Petsios, Jason Zhao, Angelos D. Keromytis and Suman Jana, “SlowFuzz: Automated Domain-Independent Detection of Algorithmic Complexity Vulnerabilities”, ACM CCS 2017, arXiv:1708.08437. https://arxiv.org/abs/1708.08437 (opens in a new tab) ↩
- Caroline Lemieux, Rohan Padhye, Koushik Sen and Dawn Song, “PerfFuzz: Automatically Generating Pathological Inputs”, ISSTA 2018 (copy hosted on wcventure.github.io). https://wcventure.github.io/FuzzingPaper/Paper/ISSTA18_PerfFuzz.pdf (opens in a new tab) ↩
- libFuzzer – a library for coverage-guided fuzz testing, LLVM documentation, accessed 1 December 2026. https://llvm.org/docs/LibFuzzer.html (opens in a new tab) ↩
- OSS-Fuzz FAQ, “How do you handle timeouts and OOMs?”, Google, accessed 1 December 2026. https://google.github.io/oss-fuzz/faq/ (opens in a new tab) ↩
- Daniel Stenberg, “This busy-loop is not a security issue”, daniel.haxx.se, 28 March 2022. https://daniel.haxx.se/blog/2022/03/28/this-busy-loop-is-not-a-security-issue/ (opens in a new tab) ↩

SecSIG