CVE-2026-40112
Cross-Site Scripting in PraisonAI Flask API Pre
Publication date: 2026-04-09
Last updated on: 2026-04-17
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| praison | praisonai | to 4.5.128 (exc) |
Helpful Resources
Exploitability
| 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.