Summary
OpenList contains a path traversal vulnerability in its authenticated batch-rename handler because attacker-controlled source names are not safely validated before file operations are performed. A user with rename permission may access or rename files outside the authorized directory and configured base path, causing cross-user integrity loss, limited availability impact, and file-existence disclosure.
Affected context
The vulnerability occurs in OpenList deployments where the authenticated /api/fs/batch_rename endpoint is enabled and a user has permission to rename files. The handler authorizes the source directory and validates the requested new name, but may process an untrusted source name without equivalent path-boundary checks, allowing path normalization to escape the intended directory or configured storage base.
Exploit preconditions
- Attack surface: Authenticated
/api/fs/batch_renameAPI endpoint - Required access: A valid user account with permission to rename files
- Trigger point: Submission of a batch-rename request containing a manipulated source-name value
- Why exploitation is possible: The source name is concatenated with an authorized path without sufficient traversal or containment validation before being passed to the filesystem rename operation
Why this happens
The underlying bug is incomplete validation of user-controlled path components. Although the destination name and source directory receive security checks, the attacker-controlled source name is trusted during path construction, allowing traversal segments to influence normalization and resolve outside the authorized directory. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal.
Potential impact
- An attacker may rename or overwrite files outside the permitted directory
- Cross-user file integrity could be compromised
- Files may become unavailable or difficult to access
- File existence may be disclosed through differing success and error responses
- Storage objects outside the intended authorization scope could be affected
General mitigation guidance
Mitigation generally focuses on treating every user-controlled path component as untrusted and enforcing authorization after canonical path resolution.
Common defensive patterns include:
- Rejecting traversal segments and absolute-path forms in all user-controlled path fields
- Resolving candidate paths canonically before checking that they remain within the authorized directory and configured storage root
- Applying authorization checks to the final source and destination paths, not only to the user-provided directory
- Preferencing storage APIs that accept opaque object identifiers rather than filesystem paths
- Restricting rename operations to explicitly permitted storage scopes and applying least-privilege service permissions
- Returning consistent responses that minimize file-existence disclosure
How teams detect issues like this
Organizations can detect related path traversal risks through:
- Static analysis rules for filesystem calls receiving concatenated or interpolated request parameters
- Code review checks for missing canonicalization and containment validation
- Tests covering traversal segments, absolute paths, encoded separators, and symlink-related boundary cases
- API policy enforcement that restricts rename targets to authorized storage scopes
- Monitoring for unusual rename activity across directories or users
Automated security review tools may help identify path construction and filesystem-boundary violations during development.

