Android: pinned OkHttpClient lazy fallback can permanently bind to non-pinned client

Abierto
#7,248 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
68/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Tranquilo
Stack tecnológico
android, kotlin
Área
mobile, security

Línea de trabajo

Comienza con MediaCallsAnswerRequest.kt:45-53 y DDPClient.kt:29; después, sigue cómo MediaCallsAnswerRequest.fetch y las conexiones de DDPClient utilizan sus clientes lazy asociados. Reproduce la ruta de inicio en frío sin ningún certificado seleccionado; después selecciona uno y verifica que las llamadas posteriores ya no reutilicen un cliente simple ni omitan silenciosamente el SSL pinning.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

needs-security-review type: bug

Problem

MediaCallsAnswerRequest.kt:45-53 and DDPClient.kt:29 both initialize the OkHttp client via a companion by lazy block:

```kotlin
private val httpClient: OkHttpClient by lazy {
SSLPinningTurboModule.getSharedOkHttpClient() ?: OkHttpClient()
}
```

If a VoIP notification (or DDP message) arrives during cold start before the user has selected a certificate, the lazy initializer triggers when the shared pinned client is still null, permanently binding to a plain OkHttpClient() for the process lifetime. Subsequent calls — including manual certificate selection later in the session — reuse the cached non-pinned fallback and silently bypass SSL pinning.

Where this surfaces

  • VoIP accept REST (MediaCallsAnswerRequest.fetch) when invoked from a PushKit/FCM cold-start handler
  • DDPClient connections under similar cold-start conditions

Suggested fix

Resolve the shared client at each call site rather than at lazy initialization, OR fail-fast with onResult(false) when getSharedOkHttpClient() returns null.

Background

Spotted by CodeRabbit on https://github.com/RocketChat/Rocket.Chat.ReactNative/pull/7245 — this is a pre-existing bug, not introduced by that PR. Filing separately so it doesn't block the release-readiness queue.

Lenguaje dominante
TypeScript
Estrellas
2.4k
Forks
1.5k
Merge medio
1 d 15 h
PR fusionados (30 d)
29

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de RocketChat/Rocket.Chat.ReactNative

Todos los issues de RocketChat/Rocket.Chat.ReactNative

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.