Critical Security Flaw in PraisonAI: Unescaped YAML Fields in Python Source Code
Summary
GHSA-qpq9-hwx9-cwgc: Duplicate Advisory This advisory has been withdrawn because it is a duplicate of GHSA-79fv-7hq9-w7xg. Affects praisonai versions < 4.6.77. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
PraisonAI is a Python package designed for generating API servers efficiently. It allows developers to configure deployment settings through various parameters. However, prior to version 4.6.78, it had a significant security flaw that could lead to code injection vulnerabilities, making it susceptible to attacks that exploit unescaped YAML fields.
Vulnerability Detail
The vulnerability arises from PraisonAI's failure to safely encode deployment configuration values when generating Python source code for API servers. Attackers can exploit this flaw by injecting arbitrary Python expressions through the 'deploy.api.host' and 'agents_file' configuration parameters. These expressions can execute when the generated server starts or processes requests, potentially leading to unauthorized access or control over the server. The vulnerability is classified under CWE-94 (Code Injection) and has a CVSS score of 7.8, indicating a high severity level.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary workaround, you can validate and sanitize the input for the 'deploy.api.host' and 'agents_file' parameters to prevent the execution of arbitrary code. Ensure that these parameters only accept expected values and reject any suspicious input.
Conclusion
The PraisonAI package has a critical vulnerability that allows for code injection through improperly handled configuration parameters. It is crucial for users to update to the latest version to mitigate this risk. Implementing input validation can serve as a temporary measure until the update is applied.
See every vulnerability recorded for praisonai →
FAQ
The vulnerability allows attackers to inject arbitrary Python code through configuration parameters, which can execute when the server starts or handles requests.
You can use Vulert's playground at Vulert Scanner to check if your application is affected without needing to sign up.
Implement input validation and sanitization for the affected configuration parameters as a temporary workaround until you can update.
The CVSS score of this vulnerability is 7.8, indicating a high severity level.
You can visit the official PraisonAI documentation or its repository on PyPI for more details about its features and usage.
References
Related vulnerabilities
Recent vulnerabilities recorded for praisonai.