EarthSystemCoG / COG

COG source code
BSD 3-Clause "New" or "Revised" License
8 stars 16 forks source link

Prevent Path Manipulation exploits #1328

Closed LucaCinquini closed 7 years ago

LucaCinquini commented 7 years ago

Who: NOAA security scan

The CoG code reads configuration files whose location is specified in cog_settings.py. If a malicious attacker has access to that configuration file, the code would be tricked into reading arbitrary files.

LucaCinquini commented 7 years ago

Fixed by validating the filepath before reading the file: o Make sure that the filename in the filepath is exactly what's expected (i.e. files with other names cannot be read) o Make sure the filepath does not contain "." (to prevent directory traversal)

murphysj commented 7 years ago

Luca says to close if everything still works.