Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-108543 Overview
CVE-2026-108543 is a path traversal vulnerability [CWE-22] affecting ag2ai ag2 versions up to and including 0.13.4. The flaw resides in the os.path.join usage within the UserProxyAgent component. An attacker can manipulate the filename argument to traverse directories outside the intended working path. The attack is network-exploitable and requires low privileges. The exploit has been publicly disclosed, and the vendor did not respond to the researcher's early disclosure attempts.
Critical Impact
Authenticated remote attackers can read, write, or reference files outside the intended UserProxyAgent working directory by supplying crafted filenames containing directory traversal sequences.
Affected Products
- ag2ai ag2 versions up to 0.13.4
- UserProxyAgent component
- Deployments integrating ag2 agents with file-handling workflows
Discovery Timeline
- 2026-10-11 - CVE-2026-108543 published to NVD
- 2026-10-13 - Last updated in NVD database
Technical Details for CVE-2026-108543
Vulnerability Analysis
The vulnerability stems from unsanitized filename input passed to Python's os.path.join inside the UserProxyAgent component of ag2. Python's os.path.join discards all prior path components when any supplied segment is absolute, and it does not normalize traversal sequences such as ../. When the UserProxyAgent concatenates a user-controlled filename with a base directory, an attacker can escape the intended directory boundary. This permits file operations against arbitrary paths accessible to the agent process. Public disclosure confirms the issue is remotely reachable with low-privileged access to the agent interface.
Root Cause
The root cause is insufficient validation of the filename argument prior to its use in os.path.join. The component trusts caller-supplied input instead of canonicalizing the resolved path and enforcing a containment check against the intended base directory. This is a textbook CWE-22 Improper Limitation of a Pathname to a Restricted Directory flaw.
Attack Vector
An attacker interacts with an ag2 deployment that exposes UserProxyAgent file operations. By supplying a filename containing traversal sequences or an absolute path, the attacker causes the agent to resolve to a location outside the intended directory. Depending on the calling code path, this can result in disclosure, overwrite, or reference of sensitive files on the host. Refer to the GitHub Vulnerability Report and VulDB CVE-2026-108543 for the technical write-up.
No verified exploit code is reproduced here. See the referenced advisories for proof-of-concept details.
Detection Methods for CVE-2026-108543
Indicators of Compromise
- Filenames submitted to ag2 agents containing ../, ..\, or absolute path prefixes such as /etc/ or C:\.
- Access or modification of files outside the ag2 working directory by the Python process hosting the agent.
- Unexpected reads of sensitive files such as /etc/passwd, SSH keys, or application configuration files.
Detection Strategies
- Instrument the UserProxyAgent call sites to log the raw filename argument and the canonicalized resolved path for every file operation.
- Compare resolved paths against the configured base directory and alert on any resolution that escapes containment.
- Review web and API gateway logs for request parameters containing encoded traversal sequences (%2e%2e%2f, ..%5c).
Monitoring Recommendations
- Enable file integrity monitoring on sensitive directories accessible to the agent process account.
- Correlate agent process file access telemetry with user session identifiers to attribute suspicious activity.
- Alert on first-time file access patterns from the ag2 process to paths outside its historical baseline.
How to Mitigate CVE-2026-108543
Immediate Actions Required
- Inventory all ag2ai ag2 deployments and identify any version at or below 0.13.4.
- Restrict network exposure of agents using UserProxyAgent to trusted callers only.
- Run the agent process under a least-privilege account with no access to sensitive host paths.
- Monitor the ag2 project repository for an official patched release and apply it when available.
Patch Information
No vendor patch is referenced in the NVD entry at the time of publication. The reporter noted the vendor was contacted but did not respond. Track the ag2 project references for updates and apply any upstream fix immediately upon release.
Workarounds
- Wrap UserProxyAgent file operations in a validation layer that canonicalizes paths with os.path.realpath and rejects any result outside the allowed base directory.
- Reject filenames containing path separators, traversal sequences, or absolute path indicators before passing them to the agent.
- Execute ag2 agents inside a container with read-only mounts and a restricted filesystem view to limit traversal impact.
- Apply an allow-list of permitted filename patterns rather than filtering disallowed characters.
# Example containment check in Python before calling UserProxyAgent file operations
# base_dir = "/opt/ag2/workdir"
# requested = os.path.realpath(os.path.join(base_dir, user_filename))
# if not requested.startswith(base_dir + os.sep):
# raise ValueError("path traversal detected")
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

