{"id":"CVE-2025-62379","aliases":["CVE-2025-62379","GHSA-rfh5-c9h5-q8jm","PYSEC-2026-1868"],"related":[],"kind":"vulnerability","state":"published","title":"Open Redirect in reflex-dev/reflex","summary":"Reflex is a library to build full-stack web apps in pure Python. In versions 0.5.4 through 0.8.14, the /auth-codespace endpoint automatically assigns the redirect_to query parameter value directly to client-side links without any validation and triggers automatic clicks when the page loads in a GitHub Codespaces environment. This allows attackers to redirect users to arbitrary external URLs. The vulnerable route is only registered when a Codespaces environment is detected, and the detection is controlled by environment variables. The same behavior can be activated in production if the GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN environment variable is set. The vulnerability occurs because the code assigns the redirect_to query parameter directly to a.href without any validation and immediately triggers a click (automatic navigation), allowing users to be sent to arbitrary external domains. The execution condition is based on the presence of a sessionStorage flag, meaning it triggers immediately on first visits or in incognito/private browsing windows, with no server-side origin/scheme whitelist or internal path enforcement defenses in place. This issue has been patched in version 0.8.15. As a workaround, users can ensure that GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN is not set in a production environment.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Reflex is a library to build full-stack web apps in pure Python. In versions 0.5.4 through 0.8.14, the /auth-codespace endpoint automatically assigns the redirect_to query parameter value directly to client-side links without any validation and triggers automatic clicks when the page loads in a GitHub Codespaces environment. This allows attackers to redirect users to arbitrary external URLs. The vulnerable route is only registered when a Codespaces environment is detected, and the detection is controlled by environment variables. The same behavior can be activated in production if the GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN environment variable is set. The vulnerability occurs because the code assigns the redirect_to query parameter directly to a.href without any validation and immediately triggers a click (automatic navigation), allowing users to be sent to arbitrary external domains. The execution condition is based on the presence of a sessionStorage flag, meaning it triggers immediately on first visits or in incognito/private browsing windows, with no server-side origin/scheme whitelist or internal path enforcement defenses in place. This issue has been patched in version 0.8.15. As a workaround, users can ensure that GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN is not set in a production environment.","source":"cvelist"},{"lang":"en","text":"### Mitigation\n\nMake sure `GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN` is not set in a production environment. So the following is correct:\n\n```\nassert os.getenv(\"GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN\") is None\n```\n\n### **Vulnerability Description**\n\n---\n\n**Vulnerability Overview**\n \n- When the GET /auth-codespace page loads in a GitHub Codespaces environment, it automatically assigns the redirect_to query parameter value directly to client-side links without any validation and triggers automatic clicks. This allows attackers to redirect users to arbitrary external URLs.\n- The route is only registered when a Codespaces environment is detected, and the detection is controlled by environment variables. This means that the same behavior can be activated in production if the corresponding environment variable is set.\n\n**Vulnerable Code Analysis**\n \n\nhttps://github.com/reflex-dev/reflex/blob/51f9f2c2f52cac4d66c07683a12bc0237311b6be/reflex/utils/codespaces.py#L18-L46\n\n- This code assigns the redirect_to query parameter directly to a.href without any validation and immediately triggers a click (automatic navigation), allowing users to be sent to arbitrary external domains, resulting in an open redirect vulnerability.\n- The execution condition is simply based on the presence of a sessionStorage flag, meaning it triggers immediately on first visits or in incognito/private browsing windows, with no server-side origin/scheme whitelist or internal path enforcement defenses in place.\n\n### PoC\n\n---\n\n**PoC Description**\n \n\n<img width=\"623\" height=\"497\" alt=\"image\" src=\"https://github.com/user-attachments/assets/55ef4828-09fa-451b-a7cc-8fcaad6a2a21\" />\n\n\n- Used the production configuration from docker-example (docker-example/production-compose).\n- Added a Codespaces detection environment variable to the app container in compose.yaml to forcibly expose the route.\n- GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN: dummy\n- The reverse proxy (Caddy) needs to be configured to forward /auth-codespace to the backend (required depending on the environment).\n\n**curl Example**\n\n\n```\nhttps://localhost/auth-codespace?redirect_to=http://google.com\n```\n\n**PoC MP4**\nhttps://file.notion.so/f/f/d105d145-04bc-45c5-b46c-ed880895e9de/a86c3e3b-f67f-45d1-8fa2-4aa0ba7d0068/poc.mp4?table=block&id=26955717-5d2e-805a-b53c-e25ee03f1d4b&spaceId=d105d145-04bc-45c5-b46c-ed880895e9de&expirationTimestamp=1760508000000&signature=ZPp8PVldfGOh0gB5tVElRV6GN789R-EG0oxZgkFjjLU&downloadName=poc.mp4\n\n<img width=\"1917\" height=\"949\" alt=\"image\" src=\"https://github.com/user-attachments/assets/e565dc4e-a59b-44d4-a92a-ebf128489e88\" />\n\n<img width=\"1913\" height=\"977\" alt=\"image\" src=\"https://github.com/user-attachments/assets/496fa585-76ea-4d2d-80f8-0ab79f51229e\" />\n\n\n\n\n### Impact\n\n---\n\n**Phishing/Social Engineering Attacks**\n\n\nUsers can be exploited by immediately redirecting from a trusted domain to external malicious sites, taking advantage of user trust. This enables login page spoofing, credential harvesting, and redirection to malware distribution pages.\n\n**Authentication/Session Flow Disruption**\n \n\nWhen users with valid sessions/cookies from the same origin click the link, they are redirected to unintended external domains, which can bypass or disrupt authentication/authorization flows. When combined with redirect-based flows like OAuth/OIDC, this can escalate into security incidents.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Reflex es una biblioteca para construir aplicaciones web full-stack en Python puro. En las versiones 0.5.4 a 0.8.14, el endpoint /auth-codespace asigna automáticamente el valor del parámetro de consulta redirect_to directamente a los enlaces del lado del cliente sin ninguna validación y activa clics automáticos cuando la página se carga en un entorno de GitHub Codespaces. Esto permite a los atacantes redirigir a los usuarios a URL externas arbitrarias. La ruta vulnerable solo se registra cuando se detecta un entorno de Codespaces, y la detección está controlada por variables de entorno. El mismo comportamiento puede activarse en producción si la variable de entorno GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN está configurada. La vulnerabilidad ocurre porque el código asigna el parámetro de consulta redirect_to directamente a a.href sin ninguna validación e inmediatamente activa un clic (navegación automática), permitiendo que los usuarios sean enviados a dominios externos arbitrarios. La condición de ejecución se basa en la presencia de una bandera de sessionStorage, lo que significa que se activa inmediatamente en las primeras visitas o en ventanas de navegación de incógnito/privada, sin defensas de lista blanca de origen/esquema del lado del servidor o de aplicación de rutas internas implementadas. Este problema ha sido parcheado en la versión 0.8.15. Como solución alternativa, los usuarios pueden asegurarse de que GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN no esté configurado en un entorno de producción.","source":"nvd"}],"published":"2025-10-15T15:57:57.208Z","modified":"2026-10-19T16:10:00.260Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:N","score":3.1,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:N","score":3.1,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:N","score":3.1,"rating":"LOW"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:N","score":3.1,"rating":"LOW"}],"cwes":["CWE-601"],"affected":[{"ranges":[{"version":">= 0.5.4, < 0.8.15","status":"affected"}],"vendor":"reflex-dev","product":"reflex","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0.5.4","status":"affected","lastAffected":"0.8.14"}],"ecosystem":"PyPI","package":"reflex","purl":"pkg:pypi/reflex","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0.5.4","status":"affected","lastAffected":"0.8.14"}],"ecosystem":"PyPI","package":"reflex","purl":"pkg:pypi/reflex","source":"pysec"}],"references":[{"url":"https://github.com/reflex-dev/reflex/security/advisories/GHSA-rfh5-c9h5-q8jm","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/reflex-dev/reflex/commit/ade12549f3c0ddab3d7382c581bc04a3c1f989ec","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-62379","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://file.notion.so/f/f/d105d145-04bc-45c5-b46c-ed880895e9de/a86c3e3b-f67f-45d1-8fa2-4aa0ba7d0068/poc.mp4?table=block&id=26955717-5d2e-805a-b53c-e25ee03f1d4b&spaceId=d105d145-04bc-45c5-b46c-ed880895e9de&expirationTimestamp=1760508000000&signature=ZPp8PVldfGOh0gB5tVElRV6GN789R-EG0oxZgkFjjLU&downloadName=poc.mp4","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/reflex-dev/reflex","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://github.com/reflex-dev/reflex/blob/51f9f2c2f52cac4d66c07683a12bc0237311b6be/reflex/utils/codespaces.py#L18-L46","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/reflex","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-rfh5-c9h5-q8jm","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-10-15T17:17:48.463Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-62379","url":"https://www.cve.org/CVERecord?id=CVE-2025-62379","licence":"CVE Terms of Use","modified":"2025-10-15T17:18:15.450Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-rfh5-c9h5-q8jm","url":"https://github.com/advisories/GHSA-rfh5-c9h5-q8jm","licence":"CC-BY-4.0","modified":"2026-07-07T17:56:21.739Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-62379","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-62379","licence":"Public domain","modified":"2026-10-19T16:10:00.260Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1868","url":"https://osv.dev/vulnerability/PYSEC-2026-1868","licence":"CC-BY-4.0","modified":"2026-07-07T17:47:00.306Z"}],"updatedAt":"2026-11-25T22:59:06.459Z","epss":{"score":0.00255,"percentile":0.18246,"date":"2026-12-02T12:00:21.000Z"}}