CVE-2025-59159: SillyTavern Web Interface Vulnerable DNS Rebinding
9.7
Basic Information
Technical Details
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| sillytavern | npm | < 1.13.4 | 1.13.4 |
Vulnerability Intelligence
Miggo AI
Root 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
hostWhitelistMiddlewaresrc/middleware/hostWhitelist.js