Skip to main content
Vulnerability Database/CVE-2026-109965

CVE-2026-109965: Serena Path Traversal Vulnerability

CVE-2026-109965 is a path traversal flaw in Serena affecting versions before 2.0.0 that enables attackers to access sensitive files outside the project root. This post covers the technical details, impact, and mitigation.

Published:

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-109965 Overview

CVE-2026-109965 is an improper link resolution vulnerability in Serena versions before 2.0.0. The flaw allows attackers to access files outside the project root by committing symbolic links inside a repository. The Project.is_path_in_project() method normalizes paths lexically without resolving symlinks. As a result, file tools such as read_file and create_text_file can read or overwrite sensitive files outside the project directory, including SSH private keys and cloud credentials. The weakness is classified as [CWE-59] Improper Link Resolution Before File Access (Link Following).

Critical Impact

An attacker who commits a malicious symlink to a repository can trick Serena's file tools into reading or overwriting arbitrary files on the host, including ~/.ssh/id_rsa and cloud provider credential files.

Affected Products

  • Serena versions prior to 2.0.0
  • The src/serena/project.py module containing Project.is_path_in_project()
  • File tools including read_file, create_text_file, and the edit API in src/serena/repl/api/edit_api.py

Discovery Timeline

  • 2026-10-13 - CVE-2026-109965 published to NVD
  • 2026-10-13 - Last updated in NVD database

Technical Details for CVE-2026-109965

Vulnerability Analysis

Serena exposes file-manipulation tools scoped to a project root directory. Before performing any file operation, the code calls Project.is_path_in_project() to confirm the target path remains inside the project. The check normalizes the path lexically using string operations rather than resolving the real filesystem path.

Attackers abuse this by committing a symbolic link inside a repository that points outside the project root, for example to ../../../home/user/.ssh/id_rsa. When Serena loads the project and invokes read_file or create_text_file on the symlink, the lexical check passes because the relative path still appears to be inside the project. The underlying filesystem then follows the symlink and operates on the external target. This produces arbitrary file read and arbitrary file overwrite primitives in the context of the user running Serena.

Root Cause

The root cause is lexical path normalization without canonicalization. Project.is_path_in_project() compared normalized string paths but did not call Path.resolve() or an equivalent function to resolve symlinks. The containment check was therefore satisfied by any relative path that looked valid syntactically, regardless of what the symlink pointed to on disk.

Attack Vector

Exploitation requires user interaction: a victim must open or operate on a repository containing attacker-controlled symlinks. The attack vector is local, but the delivery channel is typically a shared Git repository or pull request. Confidentiality and integrity impacts are both high because file read and overwrite are possible on any path readable or writable by the Serena process.

python
# Patch excerpt from src/serena/project.py
# Source: https://github.com/oraios/serena/commit/6f20f9b822d85bb063008e786f808d04619dd54e

    self, relative_path: str | Path, ignore_non_source_files: bool = True, is_file: bool | None = None
) -> bool:
    """
    Determine whether a path should be ignored based on file type, ignore patterns and on whether
    it leaves the project root through a symlink.
    Returns False for non-existent paths since they cannot be matched by ignore patterns.

    :param relative_path: Relative path to check
    """
python
# Patch excerpt from src/serena/repl/api/edit_api.py
# Source: https://github.com/oraios/serena/commit/6f20f9b822d85bb063008e786f808d04619dd54e

    :param end_line: the 0-based index of the last line to be deleted
    :return: a success message
    """
    self._get_project().validate_relative_path(relative_path)
    self._create_code_editor().delete_lines(relative_path, start_line, end_line)
    return SUCCESS_RESULT

The fix adds explicit validate_relative_path() calls in file tools and extends the ignore check to recognize paths that leave the project root through a symlink.

Detection Methods for CVE-2026-109965

Indicators of Compromise

  • Symbolic links inside a repository whose targets resolve outside the project directory, especially to ~/.ssh/, ~/.aws/, ~/.config/gcloud/, or /etc/.
  • Serena log entries showing successful read_file or create_text_file operations on paths that are symlinks to sensitive locations.
  • Unexpected modification timestamps on SSH keys, cloud credential files, or shell configuration files on hosts running Serena.

Detection Strategies

  • Scan repositories prior to opening them in Serena using find <repo> -type l -lname '/*' and find <repo> -type l -lname '../*' to flag absolute or escape-relative symlinks.
  • Audit Serena process file descriptors and system call traces for openat() calls that resolve outside the configured project root.
  • Compare the lexical path argument passed to Serena tools against the real path returned by realpath to detect divergence introduced by symlinks.

Monitoring Recommendations

  • Enable file integrity monitoring on credential locations such as ~/.ssh/, ~/.aws/credentials, and ~/.config/.
  • Alert on process executions of Serena that access paths outside declared project roots using endpoint telemetry.
  • Track Serena version strings across developer workstations and flag any instance below 2.0.0.

How to Mitigate CVE-2026-109965

Immediate Actions Required

  • Upgrade Serena to version 2.0.0 or later, which resolves symlinks before enforcing the project boundary.
  • Treat all repositories opened by vulnerable Serena versions as potentially malicious and audit for symbolic links.
  • Rotate SSH keys, cloud credentials, and API tokens stored in user home directories on any host that ran a vulnerable Serena instance against untrusted repositories.

Patch Information

The fix is delivered in Serena 2.0.0 via commit 6f20f9b822d85bb063008e786f808d04619dd54e. The patch introduces a validate_relative_path() enforcement point in file and edit tools and extends is_path_in_project() logic to reject paths that leave the project root through a symlink. See the Serena 2.0.0 release notes and the VulnCheck advisory for details.

Workarounds

  • Run Serena only against trusted repositories until the upgrade is complete.
  • Execute Serena inside a container or sandbox that does not mount sensitive host directories such as ~/.ssh or cloud credential paths.
  • Pre-scan repositories with a script that rejects any symbolic link whose resolved target lies outside the repository root before opening them in Serena.
bash
# Pre-flight scan to reject repositories containing escaping symlinks
repo_root="$(pwd)"
find "$repo_root" -type l | while read link; do
    target="$(readlink -f "$link")"
    case "$target" in
        "$repo_root"/*) ;;
        *) echo "UNSAFE symlink: $link -> $target"; exit 1 ;;
    esac
done

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

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.