Admin API has no authentication by default, and the flag that fixes it is undocumented
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 30/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- rust
- Área
- authentication, documentation, security
Línea de trabajo
Start with auth_middleware in libsql-server/src/http/admin/mod.rs, which only checks the bearer token when --admin-auth-key is set, then read handle_post_config and handle_create_namespace where jwt_key, heartbeat_url and dump_url are applied. The docs side is docs/ADMIN_API.md and the Authentication section of docs/DOCKER.md. Done means the flag and its implications are documented, and a maintainer has decided whether the admin API should fail closed without a key; that decision is not in the payload.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
sqld's admin API (enabled with --admin-listen-addr and --enable-namespaces) manages every namespace on the instance: creating, deleting, and forking namespaces, and rewriting a namespace's own config, including its jwt_key (which controls who can authenticate to that namespace's user-facing Hrana/HTTP API) and heartbeat_url / the namespace-create dump_url field (both cause the server to make an outbound HTTP request to a URL supplied in the request body).
The admin API only enforces authentication when --admin-auth-key / LIBSQL_ADMIN_AUTH_KEY has actually been set. Without it, every admin route is open to anyone who can reach the listen address. Neither docs/ADMIN_API.md (the admin API's own documentation, which explains exactly how to turn the feature on) nor docs/DOCKER.md's "Authentication" section (which documents the two user-facing auth environment variables) mentions this flag at all, so an operator following either doc has no way to learn it exists.
Affected versions: confirmed on main, commit d8bc862d20bedc72945a1da27c8b7045414c0261, and on the published image ghcr.io/tursodatabase/libsql-server:latest (sqld 0.24.33, commit d6c75af6353bb1c34985399608e37cd272a35aa1).
Details
libsql-server/src/http/admin/mod.rs's auth_middleware only checks a bearer token if one was configured at startup:
if let Some(ref auth) = auth {
// ...checks happen only inside this branch
}
Ok(next.run(request).await)
With no --admin-auth-key, this function is a no-op and every route (/v1/namespaces/:namespace/create, /v1/namespaces/:namespace (DELETE), /v1/namespaces/:namespace/fork/:to, /v1/namespaces/:namespace/config) runs unauthenticated. handle_post_config and handle_create_namespace both accept a jwt_key field and a heartbeat_url (create also accepts dump_url), and apply them with no additional check.
Steps To Reproduce
(available upon request)
Impact
Anyone who can reach the admin API's listen address, with zero credentials, can create, delete, and fork any namespace on the instance, and can rewrite a namespace's jwt_key, a full authentication bypass on every tenant namespace, since the attacker can then mint their own valid tokens for that namespace's user-facing API. The same unauthenticated requests can also set heartbeat_url or dump_url to an attacker-chosen address, causing the server to make outbound requests to arbitrary destinations, including cloud metadata endpoints. Multi-tenant namespace usage is the admin API's primary documented purpose, so this affects exactly the deployment shape the feature exists for.
I've opened a documentation PR adding this flag and its implications to both ADMIN_API.md and DOCKER.md.
- Lenguaje dominante
- C
- Estrellas
- 17.3k
- Forks
- 545
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
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 tursodatabase/libsql
-
Rust local Row::get_value truncates embedded NUL TEXT and panics on malformed UTF-8 (0.9.30)Posiblemente ocupada @Sanjays2402 la tomó hace 7 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
tursodatabase/libsql#2285 ·
-
libsql-ffi: broken builds under Nix on macOSPosiblemente ocupada @frectonz la tomó hace 57 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
tursodatabase/libsql#2275 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
tursodatabase/libsql#2226 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
tursodatabase/libsql#1925 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
tursodatabase/libsql#1892 ·
Todos los issues de tursodatabase/libsql
Issues similares
-
Go device SDK: Whisper transcriber keeps buffering and transcribing audio appended after Stop()Posiblemente ocupada @apoorvdarshan la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
BasedHardware/omi#22770 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
EchoTools/nevr-runtime#698 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
FujiNetWIFI/fujinet-firmware#2079 ·
Los mantenedores suelen responder en 1 día
-
area:ci area:runtime-vm bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
InauguralSystems/EigenScript#1859 ·
Los mantenedores suelen responder en 1 día
-
bug Official Image release/25.12 Supported Device target/kirkwood
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día