Skip to content

Commit c4cf461

Browse files
committed
Changed the way we untar a tar bundle to avoid the security vulnaribility
cr https://cr.amazon.com/r/6159171/
1 parent af05e17 commit c4cf461

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/instance_agent/platform/linux_util.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ def self.script_executable?(path)
4040

4141
def self.extract_tar(bundle_file, dst)
4242
FileUtils.mkdir_p(dst)
43-
execute_tar_command("/bin/tar -xpsf #{bundle_file} -C #{dst}")
43+
execute_tar_command("pushd #{dst} && /bin/tar -xpsf #{bundle_file} && popd")
4444
end
4545

4646
def self.extract_tgz(bundle_file, dst)
4747
FileUtils.mkdir_p(dst)
48-
execute_tar_command("/bin/tar -zxpsf #{bundle_file} -C #{dst}")
48+
execute_tar_command("pushd #{dst} && /bin/tar -zxpsf #{bundle_file} && popd")
4949
end
5050

5151
def self.supports_process_groups?()

0 commit comments

Comments
 (0)