Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raw file removal code commented in recent commit #118

Closed
heck-gd opened this issue Dec 11, 2023 · 4 comments
Closed

Raw file removal code commented in recent commit #118

heck-gd opened this issue Dec 11, 2023 · 4 comments

Comments

@heck-gd
Copy link
Contributor

heck-gd commented Dec 11, 2023

In commit ebbc5b7 the functionality for removing raw files from disk after extraction was commented.

Was this done on purpose? It looks like it may have been a test and you forgot to put it back before committing.

@heck-gd
Copy link
Contributor Author

heck-gd commented Apr 24, 2024

By the way, the same commit adds a shell command injection with this line if you control zip_path:

       p = subprocess.Popen(" ".join(["7z", "x", zip_path, "-o" + dst_path, "-y" , ">" , "/dev/nul"]), stdout=subprocess.PIPE, shell=True)

@salehmuhaysin
Copy link
Collaborator

hello
this commit is by mistake left after testing,
Regarding the 7z, it is used to avoid using the zipfile in python since it give error sometime when decompressing zip files. I think it is issue with ZipFile in python 2.7

@heck-gd
Copy link
Contributor Author

heck-gd commented May 13, 2024

Hi saleh,
The point is that using " ".join(...) AND shell=True is highly insecure. You can just pass a list directly as first Popen parameter rather than joining a string, which will cause all arguments to be quoted properly.

subprocess.Popen(["7z", "x", zip_path, "-o", dst_path, "-y"], stdout=subprocess.PIPE)

@salehmuhaysin
Copy link
Collaborator

alot of security concerns not taken into consideration, the assumption is that kuiper is running in closed environment, if somebody want to run malicious code it is possible to upload it as new parser :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants