Before opening any file, resolve its absolute path and ensure it remains within the intended base directory.
Understanding the Path Traversal Vulnerability: Target .aws/credentials -file-..-2F..-2F..-2F..-2Fhome-2F-2A-2F.aws-2Fcredentials