MobSF / Mobile-Security-Framework-MobSF

Mobile Security Framework (MobSF) is an automated, all-in-one mobile application (Android/iOS/Windows) pen-testing, malware analysis and security assessment framework capable of performing static and dynamic analysis.
https://opensecurity.in
GNU General Public License v3.0
16.68k stars 3.16k forks source link

Windows Python tempfile permission error fix #2309

Closed ohyeah521 closed 6 months ago

ohyeah521 commented 6 months ago

Fix the issue of unclosed files in Windows system causing unauthorized access to read yaml files.

return yaml.safe_load(file_obj.read_text('utf-8', 'ignore')) File "C:\Python3\lib\pathlib.py", line 1266, in read_text with self.open(mode='r', encoding=encoding, errors=errors) as f: File "C:\Python3\lib\pathlib.py", line 1252, in open return io.open(self, mode, buffering, encoding, errors, newline, File "C:\Python3\lib\pathlib.py", line 1120, in _opener return self._accessor.open(self, flags, mode) PermissionError: [Errno 13] Permission denied: 'C:\Users\test\AppData\Local\Temp\tmpclbvrcwq'

Describe the Pull Request

DESCRIBE THE DETAILS OF PULL REQUEST HERE

Checklist for PR

Additional Comments (if any)

DESCRIBE HERE