{"id":"GHSA-vmwq-8g8c-jm79","summary":"OpenChatBI has a Path Traversal Vulnerability in save_report Tool","details":"### Impact\nThe `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. \n\nThe function only removes leading dots of `file_format` using `file_format.lstrip(\".\")` but allows path traversal sequences like `/../../` to pass through unchanged. When the filename is constructed via string concatenation in \n\n    f\"{timestamp}_{clean_title}.{file_format}\"\n\nmalicious path sequences are preserved, enabling attackers to write files outside the designated report directory. \n\nAn attacker can manipulate the LLM to call the tool with a specific `file_format` to overwrite critical system files like `__init__.py`, potentially leading to remote code execution.\n\n\n### Patches\n- Affected versions:\n\u003c=0.2.1\n- Patched versions:\n0.2.2 (includes fix from PR #12: https://github.com/zhongyu09/openchatbi/pull/12)\n\n### Workarounds\nNo\n\n### References\n- Issue #10: https://github.com/zhongyu09/openchatbi/issues/10\n- PR #12: https://github.com/zhongyu09/openchatbi/pull/12","aliases":["CVE-2026-28795","PYSEC-2026-2794"],"modified":"2026-07-13T16:42:56.240887639Z","published":"2026-03-02T21:47:32Z","database_specific":{"github_reviewed":true,"github_reviewed_at":"2026-03-02T21:47:32Z","nvd_published_at":"2026-03-06T07:16:00Z","cwe_ids":["CWE-22"],"severity":"HIGH"},"references":[{"type":"WEB","url":"https://github.com/zhongyu09/openchatbi/security/advisories/GHSA-vmwq-8g8c-jm79"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-28795"},{"type":"WEB","url":"https://github.com/zhongyu09/openchatbi/issues/10"},{"type":"WEB","url":"https://github.com/zhongyu09/openchatbi/pull/12"},{"type":"WEB","url":"https://github.com/zhongyu09/openchatbi/commit/372a7e861da5159c3106d64d6f6edf8284db8c75"},{"type":"PACKAGE","url":"https://github.com/zhongyu09/openchatbi"}],"affected":[{"package":{"name":"openchatbi","ecosystem":"PyPI","purl":"pkg:pypi/openchatbi"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.2.2"}]}],"versions":["0.0.1","0.1.0","0.1.1","0.2.0","0.2.1"],"database_specific":{"last_known_affected_version_range":"\u003c= 0.2.1","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-vmwq-8g8c-jm79/GHSA-vmwq-8g8c-jm79.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"}]}