Summary
A path traversal flaw in Budibase's plugin file upload endpoint allows crafted filenames to bypass directory constraints and target arbitrary locations on the server filesystem.
When a user with Global Builder privileges uploads a plugin with a filename containing traversal sequences, they may be able to delete directories and write files anywhere the Budibase Node.js process can reach.
Affected context
This vulnerability affects Budibase deployments that expose the plugin upload functionality and grant Global Builder privileges to users.
The issue occurs in the /api/plugin/upload endpoint, which uses the user-supplied filename to create temporary folders without normalizing or rejecting ../ path traversal sequences.
It is relevant wherever the Budibase Node.js process runs with permissions to write to sensitive directories, such as configuration paths, application code directories, or shared storage volumes.
Exploit preconditions
- Attack surface: HTTP POST requests to
/api/plugin/uploadwithin a Budibase instance. - Required access: Authenticated user with Global Builder privileges (not anonymous).
- Trigger point: Crafting a multipart/form-data plugin upload whose file
filenameparameter includes../or similar traversal sequences. - Why exploitation is possible: The upload handler passes the user-controlled filename directly into
createTempFolder()without sanitization or canonicalization. This enables directory paths outside the intended upload location, allowing: - Removal of directories via
rmSync - Writing of arbitrary files via tarball extraction to attacker-controlled paths under the privileges of the Node.js process.
Why this happens
The root cause is improper neutralization of special path elements (../) in user-controlled filenames used to construct filesystem paths.
The upload endpoint trusts the filename from the multipart request and feeds it into createTempFolder() and related filesystem operations without normalization, bounding to a known-safe root, or enforcing an allowlist of valid characters and directory levels.
This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where an attacker can escape the intended directory and influence file operations on arbitrary locations.
Potential impact
- Deletion of arbitrary directories accessible to the Budibase Node.js process, potentially disrupting the application or deleting user data.
- Arbitrary file write via tarball extraction, which can modify configuration files, inject backdoors, or alter application behavior.
- Escalation of impact through modification of startup scripts, environment files, or other sensitive resources, potentially leading to remote code execution in some deployment configurations.
- Corruption of application plugins or shared libraries, affecting integrity and availability of the low-code platform.
General mitigation guidance
Effective mitigation focuses on constraining filesystem access and treating all path components derived from user input as untrusted:
- Perform strict validation and normalization of filenames and paths before use, rejecting any input containing
../, absolute path indicators, or unexpected separators. - Resolve user-supplied paths to a canonical form and enforce that they remain within a designated upload root directory (e.g., using a "chroot-like" pattern in code).
- Use generated, server-side directory names for temporary folders instead of embedding user-controlled filenames in filesystem paths.
- Apply the principle of least privilege to the Budibase Node.js process so it has minimal filesystem permissions, reducing the blast radius of any traversal bug.
- Treat archive extraction (tarball or similar) as untrusted input, validating entry paths and stripping traversal sequences before writing to disk.
How teams detect issues like this
Detection typically combines code-centric and operational approaches:
- Static analysis: Search for filesystem APIs (
fs.rmSync,fs.mkdir, archive extract calls, etc.) that use values derived from HTTP request parameters or multipart filenames without a normalization or validation step. - Code review: Flag any path construction that concatenates user input into directory paths, especially around upload handlers, temporary folder creation, and archive extraction routines.
- Runtime monitoring: Log plugin upload activity including normalized target paths, and monitor for attempts that include suspicious sequences like
../or absolute path indicators. - Policy enforcement: Integrate automated security checks into CI/CD pipelines to enforce patterns such as "no direct use of raw filenames in filesystem paths" and "archive extraction must validate entry paths."

