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

Empty string used for password with password: null | undefined passed #102

Closed
pixelastic opened this issue Jun 30, 2021 · 1 comment
Closed
Assignees

Comments

@pixelastic
Copy link
Contributor

Hello,

It seems like calling Seven.add('file.zip', ['file.txt'], { password: null }) creates a password-protected zip (I'm not sure what actual password is set, if it's an empty string or something else).

I tried with password: undefined as well but it seems that as soon as a password key is defined in the options, it triggers the behavior.

Tried with 7z from the 7zip-bin package on Ubuntu (so, 7zip version 16)

My workaround is to delete the password key if it's set before passing it to Seven

@q2s2t q2s2t self-assigned this Jul 10, 2021
@q2s2t
Copy link
Owner

q2s2t commented Jul 11, 2021

Hi,

I added a check for those cases, it will be in the next release.

However I strongly recommend against passing options with falsy values for any switch that is not a boolean. It can trigger weird behaviors with the 7-Zip CLI. Also read https://github.com/quentinrossetti/node-7z#security

@q2s2t q2s2t closed this as completed Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants