Skip to content

Fix quoting / command injection #1

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

divinity76
Copy link

@divinity76 divinity76 commented Sep 27, 2024

Previous version was vulnerable to command injection, for example if I set my password to

foo'$(id)'bar

the actual command would become

sudo bash hst-install.sh --password 'foo'$(id)'bar' 

and the actual password would become:

foouid=1002(hans) gid=1002(hans) groups=1002(hans),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),100(users),107(netdev)bar

but with this the command becomes

sudo bash hst-install.sh --password 'foo'\''$(id)'\''bar' 

and the password becomes literally

foo'$(id)'bar

Previous version was vulnerable to command injection, for example if I set my password to

foo'$(id)'bar
the actual command would become
sudo bash hst-install.sh --password 'foo'$(id)'bar' 

and the actual password would become:
foouid=1002(hans) gid=1002(hans) groups=1002(hans),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),100(users),107(netdev)bar
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

Successfully merging this pull request may close these issues.

1 participant