/

CVE-2026-44650

Severity:

CRITICAL RISK

(9.1)

Path Traversal in SillyTavern Extensions API

CVE-2026-44650

Deferred

Vulnerability type

Category:

Path Traversal / Directory Traversal

CWE:

CWE-22

Impact:

Arbitrary Directory Deletion and Data Loss

Severity:

CRITICAL RISK

(9.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A path traversal issue in SillyTavern's /api/extensions/delete endpoint allows a crafted extensionName of "." to bypass filename sanitization and trigger recursive deletion of the entire user extensions directory.

In default configurations where the API is exposed without authentication, a remote attacker can send an unauthenticated POST request and remove all installed extensions, leading to data loss and service disruption.

Affected context

The vulnerability manifests in SillyTavern instances that:

  • Expose the /api/extensions/delete HTTP endpoint
  • Rely on extensionName to select which extension to delete
  • Use filename sanitization but fail to treat "." (current directory) as a special case
  • Run in the default or otherwise unauthenticated configuration

In this context, requests can cause deletion of the full extensions directory tree when "." is accepted and resolved as the directory path itself.

Exploit preconditions

  • Attack surface: HTTP POST endpoint /api/extensions/delete
  • Required access: Network reachability to the SillyTavern instance; no authentication required by default
  • User interaction: None, beyond the attacker's own crafted HTTP request
  • Trigger point: Supplying extensionName: "." (or equivalent input) in the POST body so that server-side logic interprets it as the extensions root directory
  • Why exploitation is possible: The input validation only checks for malformed filenames but does not forbid "." or normalize and constrain the path to a specific subdirectory, allowing deletion logic to operate on the directory rather than a single file

Why this happens

This vulnerability stems from improper restriction of user-controlled path input within file-system operations.

Although SillyTavern employs a sanitize-filename mechanism, it fails to treat "." as a potentially dangerous value in the context of directory operations.

When "." is resolved by the underlying filesystem API, it refers to the current working directory, leading the deletion routine to recursively delete the entire extensions directory instead of a single named extension.

This aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory, where user-supplied data is not correctly constrained to the intended directory scope.

Potential impact

  • Deletion of all user-installed extensions within the extensions directory
  • Loss of custom configuration and extension-specific data
  • Service disruption until extensions are reinstalled or restored from backup
  • Potential loss of user trust due to unexpected data loss

General mitigation guidance

Mitigation focuses on strictly constraining file and directory operations to a well-defined path scope and hardening the API surface:

  • Treat ".", "..", empty strings, and path-like constructs as invalid values for identifiers such as extensionName
  • Resolve and normalize all paths, then enforce that the target lies strictly within the designated extensions directory before performing deletions
  • Use a whitelist-based model for deletable targets, where extensionName is matched against known extension identifiers rather than raw filesystem names
  • Apply least-privilege permissions to the runtime so that the process can only modify the minimal set of directories required
  • Require authentication and, where appropriate, authorization for administrative operations like extension deletion

These patterns reduce the risk of unintended directory-wide deletions even if input validation is later modified or bypassed.

How teams detect issues like this

Effective detection strategies generally combine code-centric and operational views:

  • Static analysis and code review:
  • Flag any endpoint that maps user input directly or indirectly into file deletion or recursive directory operations
  • Look for calls to rm -rf, fs.rmdir, fs.rm, or equivalent directory-removal APIs where the path includes user-controlled components
  • Verify that any path normalization is followed by a strict check enforcing the target directory boundary
  • Policy-based controls:
  • Enforce internal coding guidelines that require explicit checks against ".", "..", and path separators for identifier-like parameters
  • Integrate secure file-handling patterns into shared utilities and require their use instead of ad-hoc filesystem logic
  • Runtime and logging:
  • Log all extension deletion operations, including caller origin, parameters, and resolved target paths
  • Monitor logs or telemetry for anomalous bulk deletions or repeated deletion of the root extensions directory

Automated code review tools and CI-integrated linters can be configured to highlight high-risk filesystem patterns, helping maintainers catch similar vulnerabilities before release.

Sources

SourceLink
github.comgithub.com/SillyTavern/SillyTavern/security/advisories/GHSA-886q-f44j-h6wh

Frequently asked

questions

Yes, in the default configuration where no authentication is required, any remote party with network access to the SillyTavern instance can call the affected endpoint and trigger the deletion.

The attacker only needs network-level access to the exposed /api/extensions/delete endpoint.

No valid user account or API token is required if the instance is running with default unauthenticated settings.

The safest approach is to treat extensionName as a logical identifier rather than a raw filesystem path, validate it against a known set of installed extensions, and then map it to a fixed path within the extensions directory.

Coupling this with explicit rejection of special directory names (".", "..") and enforcing directory-bound checks before deletion significantly reduces risk.

Adopt a consistent filesystem security pattern: never use user input directly as a filesystem path, always normalize and bound-check derived paths, require authentication for administrative operations, and institutionalize secure coding guidelines that flag directory and file operations tied to external input.

Find out what's already
exploitable in your codebase.