VYPR
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.

PackageAffected versionsPatched versions
openchatbiPyPI
< 0.2.20.2.2

Affected products

1

Patches

1
372a7e861da5

fix: restrict file formats in save_report tool to enhance security (#12)

https://github.com/zhongyu09/openchatbiYu ZhongJan 27, 2026via ghsa
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

News mentions

0

No linked articles in our index yet.