Skip to content
OpenAdvisories
Medium · 5.4 CVE-2026-40112 EUVD-2026-21154GHSA-cfg2-mxfj-j6pwPYSEC-2026-2910

PraisonAI has Stored XSS via Unsanitized Agent Output in HTML Rendering (nh3 Not a Required Dependency)

Published Apr 9, 2026 · Updated Apr 14, 2026 · Assigned by GitHub_M

Description

PraisonAI is a multi-agent teams system. Prior to 4.5.128, the Flask API endpoint in src/praisonai/api.py renders agent output as HTML without effective sanitization. The _sanitize_html function relies on the nh3 library, which is not listed as a required or optional dependency in pyproject.toml. When nh3 is absent (the default installation), the sanitizer is a no-op that returns HTML unchanged. An attacker who can influence agent input (via RAG data poisoning, web scraping results, or prompt injection) can inject arbitrary JavaScript that executes in the browser of anyone viewing the API output. This vulnerability is fixed in 4.5.128.

Affected products

VendorProductAffectedFixed
MervinPraison PraisonAI < 4.5.128 —

Affected packages

EcosystemPackageAffectedFixedRecord
PyPI praisonai < 4.5.128 4.5.128 GHSA-cfg2-mxfj-j6pw

References