[Java][FlightSQL][JDBC] Driver drops TLS for endpoint locations advertised by the server

Abierto
#1,232 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

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

Línea de trabajo

Comienza en ArrowFlightSqlClientHandler.getStreams y rastrea cómo las ubicaciones de los endpoints anunciados configuran los clientes clonados; inspecciona ClientHandshakeWrapper para conocer la ruta de handshake observada. Reprodúcelo con withEncryption(true), credentials y un endpoint de FlightInfo inseguro; después, añade cobertura de regresión que demuestre que el requisito de cifrado configurado no se pierde silenciosamente y que credentials no se envían mediante texto plano.

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

Descripción

When a query result has endpoints with non-empty locations, ArrowFlightSqlClientHandler.getStreams clones the connection's Builder and connects to each advertised location. The clone keeps username/password, token and the OAuth config, and encryption is then set from the location scheme alone:

.withEncryption(endpointUri.getScheme().equals(LocationSchemes.GRPC_TLS))

So a location with any other scheme (grpc+tcp:// in particular) turns encryption off for that endpoint client even when the connection was opened with useEncryption=true. build() then runs the handshake and sends the credentials over the plaintext channel to the advertised host.

The documented meaning of useEncryption (default true) is "Whether to use TLS (the default is an encrypted connection)", so a server-supplied string silently overriding it is surprising: a compromised or hostile Flight SQL server, or anything able to influence the FlightInfo it returns, can have the driver hand over the user's credentials in cleartext, and a passive attacker on the endpoint path can read them.

Reproduced against a handler built with withEncryption(true) plus a username/password, given a FlightInfo with one endpoint at Location.forGrpcInsecure(...): the driver attempts the connection and reaches ClientHandshakeWrapper on the unencrypted channel instead of refusing it.

arrow-flight-sql-jdbc-driver, main.

Lenguaje dominante
Java
Estrellas
95
Forks
154
Merge medio
2 d 16 h
PR fusionados (30 d)
9

Guía de contribución

Abrir la guía de contribución

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 apache/arrow-java

Todos los issues de apache/arrow-java

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.