
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-58198 is a symlink-following arbitrary write vulnerability in ChatterBot's UbuntuCorpusTrainer.extract() method, allowing a local attacker to redirect tar archive extraction to an attacker-chosen directory. It affects all ChatterBot versions prior to 1.2.14 (pip package by gunthercox). The vulnerability was disclosed on June 19, 2026, via a GitHub Security Advisory, and published to NVD on July 9, 2026. It carries a CVSS v3.1 base score of 5.5 (Medium) (GitHub Advisory).
The root cause is a combination of CWE-59 (Improper Link Resolution Before File Access / Link Following) and CWE-367 (TOCTOU Race Condition). The extract() method uses a predictable, home-rooted output directory (~/ubuntu_data/ubuntu_dialogs) and checks for its existence with os.path.exists() before calling os.makedirs() — but os.path.exists() follows symlinks, so if an attacker pre-plants a symlink at that path, the existence check returns True, makedirs is skipped, and the subsequent tar.extractall(path=self.data_path) writes archive contents through the symlink to the attacker's chosen target directory. The existing safe_extract function validated tar member names against path traversal (zip-slip) using os.path.abspath(), but this resolves symlinks, meaning all clean-named members trivially pass the check while still writing to the attacker-controlled location. A public proof-of-concept exploit is included in the advisory (GitHub Advisory, Fix Commit).
Successful exploitation allows a local attacker with low privileges to write arbitrary files to any directory writable by the ChatterBot process, including sensitive system or application directories. The primary impact is high confidentiality loss (CVSS C:H), as an attacker could overwrite configuration files, inject malicious scripts (e.g., config.py with OS command execution), or plant files in locations that enable privilege escalation or persistence. Integrity and availability are not directly impacted per the CVSS scoring, but the ability to write attacker-controlled files to arbitrary paths creates significant secondary risk (GitHub Advisory).
UbuntuCorpusTrainer in use, and confirm local access with at least low-privilege user rights.~/ubuntu_data/ubuntu_dialogs).UbuntuCorpusTrainer.extract(), create the parent directory (~/ubuntu_data/) if it does not exist, then plant a symlink at ~/ubuntu_data/ubuntu_dialogs pointing to the attacker-chosen target directory (e.g., os.symlink('/attacker/target', '~/ubuntu_data/ubuntu_dialogs')).UbuntuCorpusTrainer.extract() (e.g., by initiating Ubuntu corpus training). The os.path.exists() check follows the symlink and returns True, skipping makedirs.tar.extractall(path=self.data_path) resolves the symlink and writes all archive members (including attacker-crafted payloads such as malicious Python scripts) into the attacker-chosen target directory.config.py with os.system('id > /tmp/chatterbot_rce')) may be executed with elevated privileges (GitHub Advisory).~/ubuntu_data/ubuntu_dialogs pointing to an unexpected directory; unexpected files (e.g., .tsv, .py scripts) appearing in directories outside ~/ubuntu_data/; files named config.py or similar with embedded OS commands in application directories.UbuntuCorpusTrainer) followed by file creation events in unexpected directories; Python tracebacks related to TrainerInitializationException on patched systems (indicating attempted exploitation)./bin/sh, id, curl) if a malicious payload was successfully written and executed./tmp/chatterbot_rce (as demonstrated in the PoC) indicating successful command execution via a written payload (GitHub Advisory).Upgrade ChatterBot to version 1.2.14 or later, which adds an explicit symlink check (os.path.islink()) before extraction, raises a TrainerInitializationException if a symlink is detected at data_path, switches is_within_directory to use os.path.realpath() instead of os.path.abspath(), and rejects symlink and hard link members within tar archives. As a workaround for those unable to upgrade immediately, ensure that the ~/ubuntu_data/ directory is created with correct permissions before any training run, and monitor for unexpected symlinks at ~/ubuntu_data/ubuntu_dialogs (GitHub Advisory, Release 1.2.14, Fix Commit).
The vulnerability was reported by researcher "AAtomical" and addressed promptly by the ChatterBot maintainer (gunthercox), who merged the fix on the same day as the advisory (June 19, 2026) via pull request #2445. No significant broader media coverage or notable community commentary beyond the GitHub advisory and standard CVE aggregator pickups has been identified (GitHub Advisory, Fix PR).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."