Advertise SCRAM-SHA-256-PLUS only on TLS connections (like postgres)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 42/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- postgresql, rust
- Área
- authentication, databases
Línea de trabajo
Start with src/api/auth/sasl.rs, src/api/mod.rs, and src/tokio/server.rs to trace how TLS state reaches authentication and how mechanisms are advertised and dispatched. Then inspect ScramServerAuth::on_client_first_message_with_secret and the changes from #476. Done means SCRAM-SHA-256-PLUS is offered and accepted only over TLS, and the y gs2 flag is rejected only on TLS when a certificate is configured.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
ScramAuth advertises SCRAM-SHA-256-PLUS whenever a certificate is configured, regardless of whether the connection is actually over TLS (rebuild_supported_mechanisms builds a static list). Channel binding is only possible over TLS, so advertising -PLUS on a plaintext connection is wrong:
-
An RFC-correct client that supports channel binding and sees
-PLUSoffered MUST use thep=gs2 flag (RFC 5802 §6) — but it cannot computetls-server-end-pointdata without TLS. Postgres avoids this trap by never offering-PLUSon non-TLS connections:// auth-scram.c, scram_get_mechanisms /* * ... Channel binding is only supported with SSL. */ if (port->ssl_in_use) appendStringInfoString(buf, SCRAM_SHA_256_PLUS_NAME); -
Interaction with #476: the gs2-flag checks added there are static — a
yflag is rejected whenever a certificate is configured, even on non-TLS connections, wherey(orn) is the only option a client has. Postgres rejectsyonly whenssl_in_use. After this change both the advertisement and the gs2 checks should key off the connection's TLS state, not just certificate configuration.
Scope
- Advertise per connection: offer
SCRAM-SHA-256-PLUSonly when the connection is secure. - Reject
-PLUSselection on non-TLS connections in the mechanism dispatch (postgres does this inscram_init: channel binding cannot be performed without SSL). - Make the gs2-flag checks connection-aware:
yshould be rejected only when the connection is over TLS and a certificate is configured.
API feasibility — what exists today vs what's missing
The TLS state is available and accurate at auth time:
negotiate_tls(src/tokio/server.rs) buildsDefaultClient::new(addr, true)right after the TLS handshake andfalsefor plain connections, before the startup/auth flow.ClientInfo::is_secure()(src/api/mod.rs) exposes it.- Both
AuthMechanism::begin(client)andAuthMechanism::next(client, msg)receive the client, soScramMechanism/SaslMechanismcan see it.
Two public surfaces currently can't use it:
SaslMechanismFactory::sasl_mechanism_names(&self)takes no client — the advertised list (src/api/auth/sasl.rs,SaslMechanism::begin) and the dispatch match are connection-blind. Needs either a client-aware variant (e.g.sasl_mechanism_names_for(&self, client: &dyn ClientInfo)with a default impl) or a signature change.- The gs2-flag checks from #476 live in
ScramServerAuth::on_client_first_message_with_secret, which has no connection context. Connection-aware enforcement needs state plumbed in — e.g. a setter on the per-connection clone (set_channel_binding_supported(bool)) or a parameter on the method. Low-level users (greptimedb) own the socket and know the TLS state, so either works for them.
So: feasible without restructuring — TLS info reaches the mechanism layer today; only the two surfaces above need extending.
Sketch
ScramAuth: filter-PLUSfrom the advertised names and from the accepted-mechanism check when!client.is_secure().- Handler layer sets the channel-binding capability on the per-connection
ScramServerAuthclone fromclient.is_secure(); low-level default stays strict (strict when a certificate is configured), documented.
- Lenguaje dominante
- Rust
- Estrellas
- 805
- Forks
- 88
- Merge medio
- 1 d 7 h
- PR fusionados (30 d)
- 10
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 sunng87/pgwire
-
`chrono` is unmaintainedPosiblemente ocupada @sunng87 la tomó hace 7 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
sunng87/pgwire#490 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Check RustCrypto for tls and signature facade apiPosiblemente ocupada @sunng87 la tomó hace 82 días. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
sunng87/pgwire#447 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
sunng87/pgwire#440 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
unquote utility to process quoted string, identPosiblemente ocupada @sunng87 la tomó hace 281 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
Todos los issues de sunng87/pgwire
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
kashsuks/Pinel#172 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
Los mantenedores suelen responder en 1 día
-
test_a_503_raises_unavailable_error fails on macOS about one run in sixPosiblemente ocupada @naman-modi la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
bug ui
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
userFRM/egui-charts#4168 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día