GHSA-7PQW-X84X-FRXC
Filesystem Bucket Containment Fails to Resolve Descendant Symlinks
Texto original en inglés · Ver en español
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-7PQW-X84X-FRXC divulgada | |
| Remediación | Parche 4.0.0 | surrealdb · 0 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
### Summary
A symbolic link traversal vulnerability exists in SurrealDB's filesystem storage bucket (`surrealdb/surrealdb`). In `surrealdb/core/src/buc/store/file.rs`, containment assertions only canonicalize the bucket root rather than resolving descendant symlinks.
### Vulnerability Details
- Affected File: `surrealdb/core/src/buc/store/file.rs` (`to_os_path`, `get`, `put`, `copy`, `rename`, `list`)
- Mechanism: The security assertion checks `path.starts_with(&self.root)` using lexical comparison. If the storage directory contains a pre-existing symbolic link pointing outside the bucket root (e.g. `<root>/link -> /etc`), requests referencing `/link/secret` satisfy the prefix check and allow arbitrary file reads and writes across the host filesystem.
- Impact: Host filesystem disclosure and modification via symlink navigation.
### Recommended Remediation
Fully canonicalize the final target path using `std::fs::canonicalize()` and verify that the canonical path resides within the canonical bucket root.
---
Reported by: ARSB
Patches
A patch has been created that canonicalizes the deepest existing ancestor of a filesystem bucket key and re-checks it against the canonical root, so an in-bucket symlink can no longer redirect an operation outside the bucket root.
- Version 4.0.0 and later are not affected by this issue.
References
- `fix(buc): filesystem bucket path traversal via symlinks, Windows backslashes, and direct-bucket keys` (commit `5edf982bf0`)
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
crates.iosurrealdb |
Corregida | 4.0.0 | 0 d | 4.0.1 no afectada |
4.0.0Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/surrealdb/surrealdb/security/advisories/GHSA-7pqw-x84x-frxcLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
