CVE-2026-4092 Overview
CVE-2026-4092 is a path traversal vulnerability affecting Clasp (Command Line Apps Script Projects), Google's official CLI tool for managing Google Apps Script projects. The vulnerability impacts versions prior to 3.2.0 and allows a remote attacker to achieve remote code execution by crafting a malicious Google Apps Script project containing specially crafted filenames with directory traversal sequences.
Critical Impact
Remote attackers can exploit this path traversal flaw to write arbitrary files outside the intended directory, potentially leading to remote code execution on developer systems that clone or pull malicious Apps Script projects.
Affected Products
- Clasp versions prior to 3.2.0
- Google Apps Script CLI tool (clasp)
- Development environments using vulnerable clasp installations
Discovery Timeline
- 2026-03-13 - CVE CVE-2026-4092 published to NVD
- 2026-03-16 - Last updated in NVD database
Technical Details for CVE-2026-4092
Vulnerability Analysis
This vulnerability is classified as CWE-22 (Improper Limitation of a Pathname to a Restricted Directory), commonly known as path traversal or directory traversal. The flaw exists in how Clasp handles filenames when processing Google Apps Script projects.
When a developer uses Clasp to clone or pull a Google Apps Script project, the tool downloads project files and saves them to the local filesystem. The vulnerability arises because Clasp fails to properly sanitize filename inputs, allowing attackers to craft malicious filenames containing directory traversal sequences such as ../ that escape the intended project directory.
An attacker can exploit this by creating a malicious Google Apps Script project with specially crafted filenames. When an unsuspecting developer clones or syncs this project using a vulnerable version of Clasp, the attacker-controlled files can be written to arbitrary locations on the developer's filesystem, potentially overwriting critical configuration files or placing malicious executables in startup directories.
Root Cause
The root cause is improper input validation of filenames received from Google Apps Script projects. The Clasp CLI tool does not adequately sanitize or validate path components within filenames before writing files to the local filesystem. This allows directory traversal sequences like ../, ..\\, or encoded variants to bypass the intended project directory boundaries.
Attack Vector
The attack is network-based and requires user interaction. An attacker must first create a malicious Google Apps Script project containing files with crafted directory traversal sequences in their names. The attacker then needs to entice a victim developer to clone or pull this malicious project using a vulnerable version of Clasp.
When the victim executes commands like clasp clone or clasp pull on the malicious project, the path traversal sequences in the filenames cause files to be written outside the expected project directory. Depending on the traversal depth and target paths, an attacker could:
- Overwrite shell configuration files (e.g., .bashrc, .zshrc) to inject malicious commands
- Place executables in user startup directories for persistence
- Modify application configuration files to alter behavior
- Write to system directories if the user has elevated privileges
The vulnerability requires no authentication to exploit, as any attacker with the ability to share a Google Apps Script project can craft the malicious payload.
Detection Methods for CVE-2026-4092
Indicators of Compromise
- Unexpected file modifications outside of Clasp project directories following clasp clone or clasp pull operations
- Presence of suspicious files in home directories or configuration folders that correlate with recent Clasp activity
- Modified shell configuration files (.bashrc, .profile, .zshrc) with unexpected entries
- Unusual file write events in system monitoring logs associated with the Clasp process
Detection Strategies
- Monitor filesystem activity during Clasp operations for writes outside the designated project directory
- Implement file integrity monitoring (FIM) on critical configuration files and directories
- Audit installed Clasp versions across development environments to identify vulnerable installations
- Review recently cloned or pulled Apps Script projects for suspicious filename patterns containing traversal sequences
Monitoring Recommendations
- Enable verbose logging for Clasp operations to capture filename handling details
- Deploy endpoint detection and response (EDR) solutions capable of monitoring CLI tool filesystem interactions
- Establish baseline file access patterns for developer workstations and alert on anomalies
- Configure alerts for file creation events in sensitive directories triggered by Node.js processes
How to Mitigate CVE-2026-4092
Immediate Actions Required
- Upgrade Clasp to version 3.2.0 or later immediately across all development environments
- Audit development workstations for vulnerable Clasp installations using clasp --version
- Review recently cloned or synced Google Apps Script projects for suspicious file activity
- Implement network-level controls to restrict access to untrusted Apps Script projects pending patch deployment
Patch Information
The vulnerability has been addressed in Clasp version 3.2.0. The fix implements proper path sanitization to prevent directory traversal sequences from escaping the project directory. Details of the patch can be found in the GitHub Pull Request #1109.
To update Clasp to the patched version, developers should run the appropriate package manager command for their environment.
Workarounds
- Avoid cloning or pulling Google Apps Script projects from untrusted or unknown sources until the update is applied
- Manually inspect project file structures before executing Clasp operations on external projects
- Run Clasp in a sandboxed or containerized environment to limit filesystem access
- Implement filesystem access controls to restrict write permissions for the Clasp process to designated project directories only
# Update Clasp to patched version
npm update -g @google/clasp
# Verify installed version is 3.2.0 or later
clasp --version
# For yarn users
yarn global upgrade @google/clasp
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

