Fix file read security issue