High severityNVD Advisory· Published Mar 6, 2026· Updated Mar 9, 2026
OpenChatBI: Critical Path Traversal Vulnerability in save_report Tool of OpenChatBI
CVE-2026-28795
Description
OpenChatBI is an intelligent chat-based BI tool powered by large language models, designed to help users query, analyze, and visualize data through natural language conversations. Prior to version 0.2.2, the save_report tool in openchatbi/tool/save_report.py suffers from a critical path traversal vulnerability due to insufficient input sanitization of the file_format parameter. This issue has been patched in version 0.2.2.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
openchatbiPyPI | < 0.2.2 | 0.2.2 |
Affected products
1- Range: < 0.2.2
Patches
1372a7e861da5fix: restrict file formats in save_report tool to enhance security (#12)
1 file changed · +7 −5
openchatbi/tool/save_report.py+7 −5 modified@@ -13,7 +13,8 @@ class SaveReportInput(BaseModel): content: str = Field(description="The content of the report to save") title: str = Field(description="The title of the report (will be used in filename)") - file_format: str = Field(description="The file format/extension (e.g., 'md', 'csv', 'txt', 'json')") + file_format: str = Field( + description="The file format/extension, only support 'md', 'csv', 'txt', 'json', 'html', 'xml'") @tool("save_report", args_schema=SaveReportInput, return_direct=False, infer_schema=True) @@ -23,11 +24,15 @@ def save_report(content: str, title: str, file_format: str = "md") -> str: Args: content: The content of the report to save title: The title of the report (will be used in filename) - file_format: The file format/extension (e.g., 'md', 'csv', 'txt', 'json') + file_format: The file format/extension, only support 'md', 'csv', 'txt', 'json', 'html', 'xml' Returns: str: Success message with download link or error message """ + allowed_formats = {'md', 'csv', 'txt', 'json', 'html', 'xml'} + if file_format not in allowed_formats: + raise ValueError(f"Unsupported file format: {file_format}") + try: # Get report directory from config report_dir = config.get().report_directory @@ -42,9 +47,6 @@ def save_report(content: str, title: str, file_format: str = "md") -> str: clean_title = "".join(c for c in title if c.isalnum() or c in (" ", "-")).rstrip() clean_title = clean_title.replace(" ", "_") - # Ensure file format doesn't have leading dot - file_format = file_format.lstrip(".") - # Create filename filename = f"{timestamp}_{clean_title}.{file_format}" file_path = Path(report_dir) / filename
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
6- github.com/advisories/GHSA-vmwq-8g8c-jm79ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2026-28795ghsaADVISORY
- github.com/zhongyu09/openchatbi/commit/372a7e861da5159c3106d64d6f6edf8284db8c75ghsax_refsource_MISCWEB
- github.com/zhongyu09/openchatbi/issues/10ghsax_refsource_MISCWEB
- github.com/zhongyu09/openchatbi/pull/12ghsax_refsource_MISCWEB
- github.com/zhongyu09/openchatbi/security/advisories/GHSA-vmwq-8g8c-jm79ghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.