CVE-2026-40112
published 2026-04-09CVE-2026-40112: 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…
PriorityP432medium6.1CVSS 3.1
AVNACLPRNUIRSCCLILAN
EPSS
0.22%
11.9th percentile
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
3 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| mervinpraison | praisonai | < 4.5.128 | 4.5.128 |
| mervinpraison | praisonai | >= 0 < 4.5.128 | 4.5.128 |
| praison | praisonai | < 4.5.128 | 4.5.128 |
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
GHSA
PraisonAI Vulnerable to Stored XSS via Unsanitized Agent Output in HTML Rendering (nh3 Not a Required Dependency)
ghsa·2026-04-10
CVE-2026-40112 [MEDIUM] CWE-79 PraisonAI Vulnerable to Stored XSS via Unsanitized Agent Output in HTML Rendering (nh3 Not a Required Dependency)
PraisonAI Vulnerable to Stored XSS via Unsanitized Agent Output in HTML Rendering (nh3 Not a Required Dependency)
## Summary
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.
## Details
In `src/praisonai/api.py`, lines 6-14 define the sanitizer with a try/except ImportError fallback:
```py
VulDB
MervinPraison PraisonAI up to 4.5.127 Flask API Endpoint src/praisonai/api.py _sanitize_html cross site scripting (GHSA-cfg2-mxfj-j6pw)
vuldb·2026-04-10·CVSS 5.4
CVE-2026-40112 [MEDIUM] MervinPraison PraisonAI up to 4.5.127 Flask API Endpoint src/praisonai/api.py _sanitize_html cross site scripting (GHSA-cfg2-mxfj-j6pw)
A vulnerability categorized as problematic has been discovered in MervinPraison PraisonAI up to 4.5.127. Affected is the function _sanitize_html of the file src/praisonai/api.py of the component Flask API Endpoint. The manipulation results in cross site scripting.
This vulnerability is cataloged as CVE-2026-40112. The attack may be launched remotely. There is no exploit available.
It is advisable to upgrade the affected component.
No detection rules found.
No public exploits indexed.
No writeups or analysis indexed.
2026-04-09
Published