Skip to content
GHSA Cxj8 27g9 669f

GHSA Cxj8 27g9 669f

github.com • November 30, 2026

MeTube’s POST /add endpoint accepts JSON request bodies without requiring Content-Type: application/json and without an application-level CSRF check, such as validating the request’s Origin header or requiring a CSRF token.

The server uses aiohttp’s request.json() to parse the body. This method decodes the body as JSON without requiring the request to use Content-Type: application/json . A browser can therefore send a cross-origin “simple” POST with Content-Type: text/plain . The browser may prevent the attacking page from reading the response, but that does not prevent the request from reaching the endpoint.

If MeTube is protected by a reverse proxy that authenticates users with browser cookies, and the victim’s browser sends that cookie with the cross-origin request, an attacker may cause the victim to enqueue a download.

MeTube’s lack of built-in authentication is intentional and is not the vulnerability being reported.

Suggested severity: Moderate , conditional on the deployment using cookie-based reverse-proxy authentication and the victim’s browser sending the authentication cookie with the cross-origin request.

JSON request parsing in _read_json_request

At the reviewed revision:

The same request-parsing pattern is present in the current master source:

The issue is exploitable when all of the following conditions are met:

MeTube is behind a reverse proxy that authenticates users with a browser cookie.

The victim is authenticated to the MeTube instance.

The victim’s browser sends the authentication cookie with a request initiated from the attacker’s page. Whether it does so depends on the cookie’s SameSite and Domain attributes and the relationship between the attacker and MeTube origins.

The proxy or another upstream component does not independently reject the request or enforce CSRF protection.

If the instance has no cookie-based authentication, or the proxy independently blocks the request, this CSRF scenario does not provide the described impact.

An attacker who can cause an authenticated victim to visit a malicious page may cause the victim’s browser to submit a download request to MeTube. The attacker does not need to read the response for the state-changing request to be sent.

The demonstrated impact is limited to actions accepted by POST /add . This report does not claim that other endpoints are affected.

Perform this test only on an isolated staging instance that you are authorized to assess and that uses the same reverse-proxy authentication and cookie settings as the deployment.

Replace metube.example and the test URL below with the staging host and a benign URL supported by that instance. Visit the test page while authenticated to MeTube.

MeTube should reject cross-origin state-changing requests unless they include a valid CSRF token or pass an explicit origin/CSRF check.

When the reverse-proxy authentication cookie is sent and the request reaches MeTube, the body is parsed as JSON and POST /add accepts the download request. The request uses Content-Type: text/plain and contains no application-level CSRF token or Origin validation.

Suggested remediation

For state-changing endpoints, reject requests from untrusted origins and/or require a CSRF token. Require the expected Content-Type: application/json before parsing JSON request bodies. Deployments using a reverse proxy for authentication should ensure that the proxy independently enforces CSRF protections.

Reviewed source revision: 292fe2d60721ae152eb80b7d12a8b8d93317c075

MeTube release version tested: [enter the release version shown in the deployed UI footer]

End-to-end exploitability depends on the reverse-proxy authentication and cookie configuration.

Maintainer note: scope and fix

The issue is broader than the report above. Every state-changing POST route was affected, including /delete and the multipart /upload-cookies , not only /add . It isn't limited to cookie-authenticating proxies either: an instance without authentication that the victim's browser can reach, or one behind HTTP basic auth, was equally exposed. Separately, the Socket.IO endpoint accepted connections from any origin, so a page on another site could read the download queue, history and configuration over a WebSocket.

Fixed in 2026.09.25. State-changing requests and Socket.IO connections from another site are refused unless the origin is listed in CORS_ALLOWED_ORIGINS , using Sec-Fetch-Site and falling back to comparing Origin with Host. Same-origin requests and clients that send no Origin header (scripts, the iOS shortcut) are unaffected.

Bookmarklet users: a bookmarklet runs on the site you click it from, so that site must now be listed in CORS_ALLOWED_ORIGINS . See #1085 .

Extracted Entities