There is a small security risk here, where people can overwrite the file since it's in a shared, well known, location. In the Azure-DevOps-Extension-Tasks we switched to using the tmp package to generate a unique path name and used the Agent's temp directory instead of /tmp as a better, more secure location. As part of creating the temporary file, we also stripped its permissions.
There is a small security risk here, where people can overwrite the file since it's in a shared, well known, location. In the Azure-DevOps-Extension-Tasks we switched to using the
tmp
package to generate a unique path name and used the Agent's temp directory instead of/tmp
as a better, more secure location. As part of creating the temporary file, we also stripped its permissions.And made sure to delete the file after execution: