Constructing file paths from user input without sanitization allows directory traversal.
Validate and sanitize file paths. Use path.resolve() and check against an allowed base directory.