Executive brief
Saltcorn is an open-source platform used to build applications without writing code. A security flaw in the server component allows an administrative user to bypass directory restrictions and download any ZIP file from the underlying server's storage. This could lead to the exposure of sensitive system data or backups that the user should not normally have access to.
Technical details
A path traversal vulnerability (CWE-22) exists in the @saltcorn/server package within the auto-backup download route. The application fails to properly sanitize the 'filename' parameter in the '/admin/auto-backup-download/:filename' endpoint before passing it to the 'res.download' API. While the code checks if the filename starts with a specific prefix and ends with '.zip', it does not resolve the path, allowing an attacker to use '../' sequences to escape the intended backup directory. Exploitation requires administrative privileges and the target file must have a .zip extension. The issue is fixed in version 1.0.0-beta.14 by resolving the filename before validation.
Affected products
- Saltcorn @saltcorn/server <= 1.0.0-beta.13
Timeline
- 2024-10-03: disclosed
- 2024-10-03: advisory
- 2024-10-03: patched