# CVE-2026-40112: PraisonAI has Stored XSS via Unsanitized Agent Output in HTML Rendering (nh3 Not a Required Dependency)

- Severity: Medium 5.4 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.23%, higher than 14% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-04-09T21:16:13.223Z
- Modified: 2026-10-26T21:10:00.170Z
- Also known as: GHSA-cfg2-mxfj-j6pw, PYSEC-2026-2910
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- 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.

(As written by CVE List.)

## Affected

- MervinPraison PraisonAI: < 4.5.128
- praisonai (PyPI): before 4.5.128
- praison praisonai: before 4.5.128

## Every score

- GitHub_M: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N`
- GitHub: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N`
- NVD: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- PyPA Advisory Database: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N`

## References

- <https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-cfg2-mxfj-j6pw> (exploit, vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-40112> (advisory)
- <https://github.com/MervinPraison/PraisonAI> (package)
- <https://github.com/MervinPraison/PraisonAI/releases/tag/v4.5.128> (web)
- <https://pypi.org/project/praisonai> (package)
- <https://github.com/advisories/GHSA-cfg2-mxfj-j6pw> (advisory)

## Sources

- CVE List: [CVE-2026-40112](https://www.cve.org/CVERecord?id=CVE-2026-40112), CVE Terms of Use, modified 2026-04-14
- GitHub Advisory Database: [GHSA-cfg2-mxfj-j6pw](https://github.com/advisories/GHSA-cfg2-mxfj-j6pw), CC-BY-4.0, modified 2026-07-13
- NVD: [CVE-2026-40112](https://nvd.nist.gov/vuln/detail/CVE-2026-40112), Public domain, modified 2026-10-26
- PyPA Advisory Database: [PYSEC-2026-2910](https://osv.dev/vulnerability/PYSEC-2026-2910), CC-BY-4.0, modified 2026-07-13

---

Page: https://cve.day/CVE-2026-40112 · Whole record: https://cve.day/CVE-2026-40112.json · Rebuilt by cve.day 2026-11-25T22:59:18.453Z
