GHSA-M448-4FVC-4CHJ
Broken access control in the FTP subsystem permits cross-site file access
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:L
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-M448-4FVC-4CHJ divulgada · CVSS 9.9 (GitHub) | |
| Remediación | Parche v0.12.30 | github.com/daptin/daptin · 16 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Broken Access Control in the FTP subsystem
Summary
Daptin's FTP server authenticated users against the global `user_account` table but did not authorize access to individual FTP-enabled sites. Any authenticated account could discover and perform file operations against sites owned by another user or administered by another group.
The issue affects deployments where `ftp.enable=true` and at least one site has `ftp_enabled=true`. The default listener is network-accessible unless operators restrict `ftp.listen_interface` or apply firewall controls.
Affected versions
All releases through `0.12.29` are affected. The vulnerable FTP implementation is unchanged between `0.12.26` and `0.12.29`. Development builds before commit `11a41bfe` are also affected.
Impact
An attacker needs valid Daptin credentials. On deployments that allow public signup, an external attacker may be able to create those credentials.
Before the fix, an authenticated user could:
- Discover every FTP-enabled site hostname.
- Read files from sites they did not own and were not authorized to access.
- Upload, overwrite, rename, chmod, or change timestamps on unauthorized files.
- Delete unauthorized files and directories.
- Trigger invalid-state failures through commands issued before selecting a site.
This compromises confidentiality, integrity, and availability of FTP-backed site content.
Resolution
Commit `11a41bfe` https://github.com/daptin/daptin/commit/11a41bfe fixes the issue on the default branch by using Daptin's existing authorization model throughout the FTP subsystem:
- FTP login constructs the existing `auth.SessionUser`, including user reference ID and usergroup memberships.
- Site discovery and entry require `PermissionInstance.CanPeek`.
- Listing, metadata, and downloads require `CanRead`.
- New uploads and directories require `CanCreate`.
- Overwrite, append, rename, chmod, and mtime operations require `CanUpdate`.
- Removal requires `CanDelete`.
- Existing administrator-group behavior is preserved by `PermissionInstance`.
- Unknown and unauthorized sites are reported equivalently to avoid site enumeration.
The fix also hardens the filesystem boundary:
- FTP paths are confined to the selected site's synchronized storage root.
- Parent traversal and symlink escape are rejected.
- Cross-site rename and site-root delete/rename are rejected.
- Invalid session, site, and storage states return errors instead of panicking.
- STOR truncates existing files without delete-and-recreate behavior.
- Directory listings return real entries and propagate filesystem errors.
Regression coverage includes owner, related-usergroup, administrator, and unrelated-user behavior; operation-specific permissions; traversal and symlink attempts; cross-site rename; malformed and pre-site commands; and overwrite semantics. Focused race tests, `go test -race ./server/...`, the full repository suite, `go vet ./server/...`, and a fresh-instance end-to-end replay of the original attack scenario pass.
Mitigation
Until a patched release is available and deployed:
- Set `ftp.enable=false` and restart Daptin.
- If FTP cannot be disabled, restrict the FTP listener to trusted networks or a VPN.
- Disable public signup when it is not required.
- Review FTP-backed storage for unexpected changes and rotate secrets exposed through site files.
Site and site-usergroup permissions are loaded when the FTP server starts. Restart Daptin after changing FTP configuration, `ftp_enabled`, site permissions, or site-usergroup relationships.
Secure configuration and permission guidance is available in the FTP Server wiki https://github.com/daptin/daptin/wiki/FTP-Server. The beginner setup guide was added in documentation commit `b83c9926` https://github.com/daptin/daptin/commit/b83c9926.
Credit
Reported by `tinyb0y`.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
gogithub.com/daptin/daptin |
Corregida | v0.12.30 | 16 d | v0.13.57 no afectada |
v0.12.30Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/daptin/daptin/security/advisories/GHSA-m448-4fvc-4chjLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
