Skip to content

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