VAITP Dataset

← Back to the dataset

CVE-2026-104266

Infinite loop in tinytag 2.0.0-2.3.0 when parsing crafted M4A atom, causing DoS.

  • CVSS 6.5
  • CWE-835
  • Resource Management
  • Local

tinytag is a Python library for reading audio file metadata. From 2.0.0 until 2.3.0, an M4A file containing a sub-atom with a size of zero inside a —- atom can cause the metadata parser to stop advancing through the input. The custom-field atom traversal repeatedly processes the malformed location, causing an infinite loop and denying service to a program that reads the crafted file. This issue is fixed in version 2.3.0.

CVSS base score
6.5
Published
2026-10-15
OWASP
A04 Insecure Design
Orthogonal defect classification
Timing/Serialization
Code defect classification
Timing Issues
Category
Resource Management
Subcategory
Resource Exhaustion
Accessibility scope
Local
Impact
Denial of Service (DoS)
Affected component
Python
Fixed by upgrading
Yes

Solution

Upgrade tinytag to version 2.3.0 or later.

Vulnerable code sample

from tinytag import TinyTag

def extract_custom_fields(path):
    """
    Open an M4A file and iterate over custom atoms.
    Vulnerable to zero‑length sub‑atom causing an infinite loop.
    """
    tag = TinyTag.get(path)
    # VULNERABLE: infinite loop when a sub‑atom reports size 0
    with open(path, "rb") as f:
        f.seek(tag._audio_offset)          # start of atom list (simplified)
        while True:
            header = f.read(8)
            if len(header) < 8:
                break
            atom_size = int.from_bytes(header[:4], "big")
            # If atom_size is zero the file pointer is not advanced,
            # causing the loop to repeat forever.
            f.seek(atom_size - 8, 1)       # advance to next atom

Patched code sample

from tinytag import TinyTag

def extract_custom_fields(path):
    """
    Open an M4A file and iterate over custom atoms.
    Fixed by refusing to process zero‑length atoms.
    """
    tag = TinyTag.get(path)
    # FIX: break loop when a sub‑atom reports size 0 to avoid infinite looping
    with open(path, "rb") as f:
        f.seek(tag._audio_offset)          # start of atom list (simplified)
        while True:
            header = f.read(8)
            if len(header) < 8:
                break
            atom_size = int.from_bytes(header[:4], "big")
            if atom_size == 0:
                break                     # stop processing malformed atom
            f.seek(atom_size - 8, 1)       # advance to next atom

Published fix

Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.

  • MP4: Refactor atom parsing (#326) (tinytag/tinytag)
    tinytag/tinytag.py, tinytag/tinytag.py · _MP4._data_parser, tinytag/tinytag.py · _MP4._nums_parser, tinytag/tinytag.py · _MP4._parse_cover_image, tinytag/tinytag.py · _MP4._parse_custom_field, tinytag/tinytag.py · _MP4._parse_id3v1_genre, tinytag/tinytag.py · _MP4._parse_uuid, tinytag/tinytag.py · _MP4._traverse_atoms

Cite this entry

@misc{vaitp:cve2026104266,
  title        = {{Infinite loop in tinytag 2.0.0-2.3.0 when parsing crafted M4A atom, causing DoS.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-104266},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-104266/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.