Summary
TS3 Manager contains a reflected cross-site scripting vulnerability in the API download handler, where attacker-controlled input is returned as HTML without sufficient browser protections. If a logged-in operator follows a crafted link, script execution in the manager origin may expose the operator token and decoded ServerQuery credentials, potentially enabling control of the managed TeamSpeak server.
Affected context
The issue occurs in TS3 Manager deployments where the download API reflects a query parameter through an HTML response without effective output encoding or a Content Security Policy. Risk is increased when an authenticated operator can be induced to visit a top-level link and the session token is accessible to client-side scripts. The impact is especially serious when the token or JWT contains administrative ServerQuery credentials.
Exploit preconditions
- Attack surface: The
/api/downloadHTTP handler and its reflected error response - Required access: A valid logged-in operator session and operator interaction with a crafted link
- Trigger point: Processing an attacker-controlled port query parameter and returning the resulting error text as HTML
- Why exploitation is possible: Unencoded reflected data can execute in the manager origin, while a script-readable token can be used to access application functionality and retrieve sensitive decoded JWT contents
Why this happens
The vulnerability results from reflecting attacker-controlled input into an HTML response without context-appropriate output encoding or a restrictive Content Security Policy. This is a reflected cross-site scripting condition mapped to CWE-79, because untrusted data is interpreted as browser-executable markup or script in the application's origin. The risk is amplified by storing an authentication token without protective cookie attributes and by exposing sensitive administrative credentials through a client-accessible application flow.
Potential impact
- An attacker may execute script in the manager origin
- An attacker could read the exposed authentication token
- An attacker may retrieve sensitive ServerQuery credentials
- An attacker could hijack the operator session
- An attacker could modify or control the managed TeamSpeak server
- Confidentiality and integrity of managed server data may be affected
General mitigation guidance
Mitigation generally focuses on treating all query parameters and error content as untrusted data.
Common defensive patterns include:
- Apply context-aware HTML output encoding or return structured, non-HTML error responses
- Use a restrictive Content Security Policy that limits script execution and reduces XSS impact
- Configure authentication cookies with
HttpOnly,Secure, and an explicit appropriateSameSitepolicy - Avoid exposing cleartext administrative credentials or reusable privileged tokens to browser-accessible code
- Minimize token scope, lifetime, and privileges, and separate operator authentication from server administration credentials
- Validate query parameters against strict type and range requirements before processing them
- Require explicit authorization checks for sensitive socket and autofill operations
How teams detect issues like this
Organizations can identify similar issues through:
- Static analysis rules for concatenating request parameters into HTML responses
- Code review checks for response methods that send unescaped error messages as
text/html - Tests that submit unexpected values to query parameters and verify that responses contain no executable markup
- Review of cookie declarations for missing
HttpOnly,Secure, or explicitSameSiteattributes - Monitoring for unusual operator-session use, token access, and administrative ServerQuery activity
- Policy enforcement requiring structured error responses, output encoding, and restrictive browser security headers
- Automated security review tools that flag reflected input and client-accessible privileged tokens

