[Security] Encoded backslash bypass in post_logout_redirect_uri can cause open redirect
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 30/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- azure
- Área
- authentication, cloud, security
Línea de trabajo
Comienza reproduciendo el flujo de dos pasos /.auth/logout y /.auth/logout/complete con los comandos curl proporcionados, conservando la cookie e inspeccionando Location sin seguir las redirecciones. El informe no menciona archivos del repositorio e identifica el comportamiento como gestionado por la plataforma. Se considera completado cuando los destinos no seguros con barras invertidas codificadas se rechazan o se reemplazan por un destino fijo del mismo origen.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
Azure Static Web Apps managed authentication appears to accept an encoded backslash in post_logout_redirect_uri, then reflect the decoded value from /.auth/logout/complete. In browsers, the resulting URL can be normalized as a scheme-relative external redirect.
This appears to be an open redirect in the platform-managed /.auth/* authentication flow.
Affected flow
-
GET /.auth/logout?post_logout_redirect_uri=/%5Cattacker.example -
The request is accepted and establishes the managed-auth logout context.
-
GET /.auth/logout/completewith the resulting cookie. -
The response may be a redirect such as:
Location: /\\attacker.example -
Browser URL normalization can interpret
/\\attacker.exampleas an off-origin scheme-relative URL.
Expected behavior
post_logout_redirect_uri should be accepted only when it is a safe same-origin path, for example /dashboard. Inputs containing backslashes, encoded backslashes, control characters, or any form that can normalize to an authority should be rejected or replaced with a fixed local destination.
Observed behavior
Obvious absolute and scheme-relative external URLs are rejected, but the encoded-backslash form is accepted and reflected by the logout completion endpoint. This suggests validation and browser URL parsing use different normalization rules.
Security impact
An attacker can create a link that appears to target a legitimate Static Web App, but after logout the browser may be redirected to an attacker-controlled origin. This can support phishing and credential-harvesting flows.
Reproduction
Use a test Static Web App domain and a cookie jar:
HOST=https://<static-web-app-domain>
curl -s -D - -o /dev/null -c cookies.txt \
$HOST/.auth/logout?post_logout_redirect_uri=/%5Cattacker.example
curl -s -D - -o /dev/null -b cookies.txt \
$HOST/.auth/logout/complete
Please verify the Location header without following redirects. A vulnerable response is one that reflects a value equivalent to /\\attacker.example, which browsers may normalize to an external scheme-relative URL.
Notes
- This concerns the Azure Static Web Apps managed-auth endpoints, not application route configuration.
- A
staticwebapp.config.jsonroute rule for/.auth/logoutdoes not appear to intercept the reserved managed-auth endpoint before the platform handler processes it. - Please treat this as a security report and advise whether Microsoft prefers private disclosure through the MSRC process.
Suggested fix
Normalize and validate the redirect target using browser-compatible URL parsing. Reject backslashes and encoded backslashes before validation, reject any target whose normalized authority differs from the current host, and use a fixed same-origin fallback when validation fails.
Attack flow
OPEN REDIRECT via SWA managed-auth
affected flow: `/.auth/logout` -> `/.auth/logout/complete`
================================================================================
ATTACKER VICTIM BROWSER AZURE STATIC WEB APPS
(platform managed-auth
layer, `/.auth/*`)
| | |
| phishing link | |
|------------------------->| |
| | |
| STEP 1: seed the redirect target into the cookie |
| | |
| | GET `/.auth/logout` |
| | ?post_logout_redirect_uri=/%5Cattacker.example
| |---------------------------------->|
| | | validate(uri)
| | | `/\` passes
| | 302 Found |
| | Location: `https://identity.5.azurestaticapps.net/`
| | `.redirect/logout?hostName=...`
| | Set-Cookie: `StaticWebAppsAuthContextCookie=<enc>`
| | Secure; HttpOnly; SameSite=None <-- sent cross-site
|<-------------------------| |
| | [target is stored in the managed-auth context]
| | |
| STEP 2: trigger the completion handler |
| | |
| | GET `/.auth/logout/complete` |
| | Cookie: `StaticWebAppsAuthContextCookie=<enc>`
| |---------------------------------->|
| | | reflect(cookie.uri)
| | 302 Found |
| | Location: `/\attacker.example` <== TAINTED
|<-------------------------| |
| | |
| | browser normalizes `/\` -> `//`
| | => scheme-relative URL
| v |
| `https://attacker.example` (off-origin)
| |
|<-------------------------+ attacker-controlled page
- Lenguaje dominante
- Sin datos de lenguaje
- Estrellas
- 347
- Forks
- 68
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Azure/static-web-apps
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Azure/static-web-apps#1764 · 2 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
Azure/static-web-apps#1827 ·
-
Managed Functions Not RestartingAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Azure/static-web-apps#1826 · 5 comentarios · 1 reacción ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
Azure/static-web-apps#1825 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 18/100
Azure/static-web-apps#1824 ·
Todos los issues de Azure/static-web-apps
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 69/100
StevenBlack/hosts#3314 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 3 días
-
Security sweep findingsAbiertosecurity-sweep
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100