Miggo Logo

CVE-2025-59159: SillyTavern Web Interface Vulnerable DNS Rebinding

9.7

CVSS Score
3.1

Basic Information

EPSS Score
-
Published
10/6/2025
Updated
10/6/2025
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
sillytavernnpm< 1.13.41.13.4

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability is a classic DNS rebinding attack. The root cause is the SillyTavern server's failure to validate the Host header of incoming HTTP requests. An attacker can leverage this by having a victim visit a malicious website. This website's domain initially resolves to the attacker's server, but then, after a short TTL, it rebinds to 127.0.0.1. The malicious JavaScript, now running on a domain that points to the local SillyTavern instance, can make arbitrary API calls, effectively giving the attacker full control over the user's SillyTavern.

The provided patch addresses this by introducing a middleware, hostWhitelistMiddleware, in src/middleware/hostWhitelist.js. This middleware is added to the main Express application stack in src/server-main.js to intercept all incoming requests.

The function hostWhitelistMiddleware is the critical component in the context of this vulnerability. It is designed to check the Host header against a configurable whitelist. However, the patch makes this feature opt-in (hostWhitelist.enabled is false by default). When the feature is disabled, the middleware directly calls next(), allowing the request to be processed by the downstream API endpoints without any host validation. This means that even with the patched code, a default installation remains vulnerable.

During an exploit, the attacker's script would make requests to various API endpoints. Every one of these malicious requests would first pass through the hostWhitelistMiddleware. Because this function is the gatekeeper that fails to stop the malicious request (when disabled), it is the most relevant function to identify for profiling and runtime analysis. Any subsequent function in the stack that processes the request (e.g., for reading chats, installing extensions) is being subjected to the exploit because of the initial failure in hostWhitelistMiddleware.

Vulnerable functions

hostWhitelistMiddleware
src/middleware/hostWhitelist.js
The vulnerability is a DNS rebinding issue, which stems from the application's failure to validate the `Host` header of incoming HTTP requests. This allows an attacker-controlled website to make requests to the SillyTavern server as if they were from the local machine, bypassing the browser's Same-Origin Policy. The patch introduces the `hostWhitelistMiddleware` as a mitigation. This function inspects the `Host` header of every request. However, the advisory notes that this feature is disabled by default for backward compatibility (`hostWhitelist.enabled: false`). When disabled, the middleware simply calls `next()`, passing the request down the chain to the application's route handlers without any validation. Therefore, any request handled by the application is potentially malicious, and this middleware is the entry point for that request into the application logic where the validation *should* occur. During exploitation, this function will be in the call stack for every incoming request from the attacker.

WAF Protection Rules

WAF Rule

### Summ*ry T** w** UI *or SillyT*v*rn is sus**pti*l* to *NS r**in*in*, *llowin* *tt**k*rs to p*r*orm **tions lik* inst*ll m*li*ious *xt*nsions, r*** ***ts, inj**t *r*itr*ry *TML *or p*is*in*, *t*. ### **t*ils *NS r**in*in* is * m*t*o* to *yp*ss t**

Reasoning

T** vuln*r**ility is * *l*ssi* *NS r**in*in* *tt**k. T** root **us* is t** SillyT*v*rn s*rv*r's **ilur* to v*li**t* t** `*ost` *****r o* in*omin* *TTP r*qu*sts. *n *tt**k*r **n l*v*r*** t*is *y **vin* * vi*tim visit * m*li*ious w**sit*. T*is w**sit*'