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

CVE-2026-108751: MoAI-ADK Path Traversal Vulnerability

CVE-2026-108751 is a path traversal flaw in MoAI-ADK that exploits symlinked paths to overwrite files outside project directories. This post explains its impact, affected versions, and mitigation steps.

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

CVE-2026-108751 is an improper link resolution vulnerability [CWE-59] in MoAI-ADK versions through 3.1.2. The flaw resides in the moai init template deployer, which stages files through a .moai-tmp path. A malicious repository can commit a symlink such as .claude/settings.json.moai-tmp that points outside the project directory. When the deployer calls atomicWriteFile, it follows the symlink and overwrites victim-writable files with MoAI template content. Exploitation requires local user interaction, specifically running moai init against an attacker-controlled repository. The vulnerability affects file integrity and availability on the local system.

Critical Impact

Malicious MoAI-ADK template repositories can overwrite arbitrary files writable by the user running moai init, enabling tampering with configuration files, scripts, or dotfiles outside the intended project directory.

Affected Products

  • MoAI-ADK through version 3.1.2
  • moai init template deployer component (internal/template/deployer.go)
  • Projects initialized from untrusted MoAI-ADK template repositories

Discovery Timeline

  • 2026-10-11 - CVE-2026-108751 published to NVD
  • 2026-10-16 - Last updated in NVD database

Technical Details for CVE-2026-108751

Vulnerability Analysis

MoAI-ADK's template deployer writes files atomically by first creating a staging file with a .moai-tmp suffix, then renaming it over the final destination. The staging path is derived from the destination filename and placed under the project root. The deployer does not verify whether the staging path is a regular file or a symbolic link before writing. When a template source repository contains a symlink named with the .moai-tmp suffix, the deployer follows that symlink during the write operation.

The atomicWriteFile routine opens the staging path with truncation semantics. If the path resolves through a symlink to a file outside the project, the target file is truncated and overwritten with template content. The impact is bounded by the file system permissions of the invoking user. See the VulnCheck advisory and the HackMD write-up for complete technical details.

Root Cause

The root cause is the absence of symlink validation before writing to the staging path. The deployer trusts repository-controlled filenames and does not call lstat or use O_NOFOLLOW semantics when opening the destination. Any path ending in .moai-tmp is treated as a safe staging target, even when supplied by a cloned template repository. See the referenced deployer.go lines 160-203 for the vulnerable logic.

Attack Vector

An attacker publishes or controls a MoAI-ADK template repository. The repository contains a symlink such as .claude/settings.json.moai-tmp whose link target is an absolute or relative path to a file outside the project root, for example ~/.ssh/authorized_keys or ~/.bashrc. When a victim runs moai init and selects the attacker's template, the deployer writes template content through the symlink, truncating and overwriting the victim's file. Exploitation is local and requires user interaction but needs no elevated privileges.

No verified proof-of-concept code is published. The vulnerability is described in prose in the referenced advisories.

Detection Methods for CVE-2026-108751

Indicators of Compromise

  • Presence of files ending in .moai-tmp that are symbolic links rather than regular files inside a cloned template repository
  • Unexpected modifications to user-writable files such as shell profiles, SSH configuration, or editor settings shortly after running moai init
  • MoAI template content appearing in files outside the initialized project directory

Detection Strategies

  • Scan template repositories for symlinks before invocation: find . -type l -name '*.moai-tmp'
  • Enable file integrity monitoring on sensitive user configuration directories such as ~/.ssh, ~/.config, and shell dotfiles
  • Audit process execution logs for moai init invocations correlated with file writes outside the project working directory

Monitoring Recommendations

  • Collect endpoint telemetry on openat and rename syscalls initiated by the MoAI binary and alert on writes that traverse symlinks outside the current working directory
  • Monitor developer workstations for cloning of untrusted MoAI template repositories
  • Review MoAI-ADK version strings deployed across developer and CI/CD environments to identify systems still running 3.1.2 or earlier

How to Mitigate CVE-2026-108751

Immediate Actions Required

  • Upgrade MoAI-ADK beyond version 3.1.2 once a fixed release is published by the maintainers
  • Only run moai init against template repositories from trusted, verified sources
  • Inspect any third-party template repository for symlinks before initialization

Patch Information

At time of publication, no fixed version is explicitly identified in the NVD record. Monitor the MoAI-ADK GitHub repository for a release that adds symlink validation to the template deployer. Review the VulnCheck advisory for updated remediation guidance.

Workarounds

  • Run moai init inside a disposable sandbox, container, or unprivileged user account that lacks write access to sensitive files
  • Pre-scan template repositories with find . -type l and reject any repository containing symlinks ending in .moai-tmp
  • Restrict the MoAI binary's execution environment using mandatory access controls such as AppArmor or SELinux profiles that deny writes outside the project directory
bash
# Pre-flight check for malicious staging symlinks in a cloned template repo
git clone <template-repo> ./template-check
find ./template-check -type l -name '*.moai-tmp' -print
# If any output is produced, do not run `moai init` against this repository

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.