Functions need input validation and sanitization of filenames/paths to prevent issues from user-controlled data such as file deletion or local/remote file inclusion attacks. Proper validation and sanitization is required to avoid security risks.