CVE-2026-40112
Received Received - Intake
Cross-Site Scripting in PraisonAI Flask API Pre

Publication date: 2026-04-09

Last updated on: 2026-04-17

Assigner: GitHub, Inc.

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.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-04-09
Last Modified
2026-04-17
Generated
2026-05-06
AI Q&A
2026-04-10
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
praison praisonai to 4.5.128 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-79 The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

PraisonAI is a multi-agent teams system that had a vulnerability prior to version 4.5.128. The Flask API endpoint in the source file src/praisonai/api.py rendered agent output as HTML without proper sanitization. The sanitization function, _sanitize_html, depended on the nh3 library, which was not included as a required or optional dependency. When nh3 was not installed (which is the default), the sanitizer did nothing and returned the HTML unchanged. This allowed an attacker who could influence the agent inputβ€”through methods like RAG data poisoning, web scraping results, or prompt injectionβ€”to inject arbitrary JavaScript code. This malicious script would then execute in the browsers of users viewing the API output. The issue was fixed in version 4.5.128.


How can this vulnerability impact me? :

This vulnerability can lead to cross-site scripting (XSS) attacks, where an attacker injects malicious JavaScript into the API output viewed by users. As a result, attackers could execute arbitrary scripts in the browsers of users interacting with the PraisonAI system. This can lead to theft of sensitive information, session hijacking, or other malicious actions performed on behalf of the user.


What immediate steps should I take to mitigate this vulnerability?

To mitigate this vulnerability, upgrade PraisonAI to version 4.5.128 or later where the issue is fixed.

Ensure that the nh3 library is properly installed and listed as a dependency to enable effective HTML sanitization.

Avoid using versions prior to 4.5.128, as they allow arbitrary JavaScript injection via unsanitized agent output.


How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

This vulnerability allows an attacker to inject arbitrary JavaScript into the HTML output of the PraisonAI Flask API endpoint, which executes in the browser of anyone viewing the output. Such cross-site scripting (XSS) risks can lead to unauthorized access to sensitive information or user data.

Because of the potential for unauthorized data access or exposure, this vulnerability could negatively impact compliance with data protection regulations such as GDPR and HIPAA, which require safeguarding personal and sensitive information against unauthorized access or disclosure.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart