Summary
An unauthenticated server-side request forgery (SSRF) issue in Postiz's /public/stream endpoint allows attackers to supply arbitrary URLs that the server will fetch and proxy back, with only a weak .mp4 suffix check.
By trivially bypassing this validation, an attacker can coerce the Postiz server into making HTTP requests to internal services, cloud metadata endpoints, and other network-internal resources, exposing sensitive response data.
Affected context
This vulnerability occurs in Postiz deployments that expose the unauthenticated GET /public/stream HTTP endpoint.
The endpoint is designed to proxy media content but accepts a user-controlled url parameter and returns the full HTTP response body back to the caller.
The only validation is a string check that the URL ends with "mp4", which can be bypassed via query strings or URL fragments.
The issue is most impactful in environments where the Postiz server can reach internal HTTP services, container orchestration control planes, or cloud provider metadata endpoints.
Exploit preconditions
- Attack surface: Publicly exposed HTTP interface at
GET /public/stream. - Required access: None; the endpoint does not require authentication or prior interaction.
- Attacker control: Ability to supply an arbitrary
urlquery parameter value to the endpoint. - Trigger point: The application forwards the attacker-specified URL request and streams the response back to the client.
- Why exploitation is possible: URL validation relies only on
url.endsWith("mp4"), which can be bypassed using query parameters or fragments, and there are no restrictions on destination IP ranges, hostnames, or protocols, nor any SSRF-specific protections.
Why this happens
The underlying bug is a classic SSRF pattern: a backend component makes outbound HTTP requests based on user-provided URLs, then returns the response to the user without constraining where the server can connect.
In this case, the PublicController's /public/stream endpoint serves as a generic proxy, trusting the url parameter with only a superficial suffix check.
This maps directly to CWE-918: Server-Side Request Forgery (SSRF), where the server becomes an unintended HTTP client for the attacker, bridging otherwise unreachable internal networks and metadata services.
The key insecure pattern is coupling user-controlled URLs with server-side HTTP clients, without strict allow-listing, network egress controls, or content validation.
Potential impact
- Reading responses from internal HTTP services (e.g., admin panels, APIs, dashboards) not exposed to the public internet.
- Accessing cloud provider metadata endpoints, which may reveal access tokens, instance credentials, or configuration data.
- Enumerating internal network structure and services reachable from the Postiz server.
- Exfiltration of configuration files, internal status endpoints, or debug interfaces that expose sensitive information.
- Assisting in lateral movement by combining leaked secrets or internal knowledge with other vulnerabilities.
- Potential indirect impact on availability if internal services are abused or overloaded by crafted SSRF traffic.
General mitigation guidance
Mitigation strategies focus on breaking the trust boundary between user-controlled URLs and backend HTTP clients, and minimizing where the server can connect:
- Replace arbitrary URL proxying with a strict allow-list of trusted domains or paths, configured centrally and not influenced by user input.
- Perform robust URL validation and normalization, ensuring checks are applied to the canonicalized URL, including scheme, host, port, and path, not just string suffixes.
- Enforce network-layer egress controls so the application server cannot initiate requests to internal IP ranges, link-local addresses, or cloud metadata endpoints.
- Use segregated HTTP clients for external resources, configured with explicit DNS resolution, timeouts, and restricted destination ranges.
- Avoid returning raw upstream responses; instead, forward only the minimal necessary data and sanitize headers to reduce information leakage.
- Apply the principle of least privilege to the runtime environment so that any credentials accessible from the server or metadata endpoints are tightly scoped.
How teams detect issues like this
Detecting and preventing SSRF patterns often involves a mix of code-level and infrastructure-level measures:
- Static analysis: Flag usages of HTTP client libraries where the target URL is derived from request parameters, query strings, or other untrusted input, especially in controller or proxy-like code paths.
- Code review cues: Look for endpoints that "proxy," "stream," or "fetch" external content, and ensure they use allow-lists, strong validation, and network restrictions.
- Security testing: Incorporate SSRF checks into automated and manual testing, using crafted URLs that target internal IP ranges and metadata endpoints to validate protections.
- Runtime monitoring: Configure network monitoring and WAF rules to detect anomalous outbound traffic patterns, such as requests from application servers to internal ranges or well-known metadata IPs (e.g., 169.254.169.254).
- Policy enforcement: Use infrastructure-as-code and container/orchestrator policies to restrict outbound connectivity from application pods or instances, and periodically audit for components acting as open proxies.

