Re: Arbitrary command execution from test on a quoted string

2021-10-28 Thread Léa Gris
Le 29/10/2021 à 00:29, Greg Wooledge écrivait : On Thu, Oct 28, 2021 at 08:33:22PM +, elettrino via Bug reports for the GNU Bourne Again SHell wrote: user@machine:~$ USER_INPUT='x[$(id>&2)]' user@machine:~$ test -v "$USER_INPUT" uid=1519(user) gid=1519(user) groups=1519(user),100(users) us

Re: Arbitrary command execution from test on a quoted string

2021-10-28 Thread Greg Wooledge
On Thu, Oct 28, 2021 at 08:33:22PM +, elettrino via Bug reports for the GNU Bourne Again SHell wrote: > > user@machine:~$ USER_INPUT='x[$(id>&2)]' > user@machine:~$ test -v "$USER_INPUT" > uid=1519(user) gid=1519(user) groups=1519(user),100(users) > user@machine:~$ Whoo. This uses a feature

Re: Arbitrary command execution from test on a quoted string

2021-10-28 Thread Kerin Millar
On Thu, 28 Oct 2021 20:33:22 + elettrino via Bug reports for the GNU Bourne Again SHell wrote: > The following shows an example of bash testing a quoted string and as a > result executing a command embedded in the string. > > Here I used the command "id" to stand as an example of a command

Arbitrary command execution from test on a quoted string

2021-10-28 Thread elettrino via Bug reports for the GNU Bourne Again SHell
The following shows an example of bash testing a quoted string and as a result executing a command embedded in the string. Here I used the command "id" to stand as an example of a command. The output of id on this machine was as follows: user@machine:~$ id uid=1519(user) gid=1519(user) groups=1

Re: unexpected exit code for integer operation

2021-10-28 Thread Toralf Förster
On 10/27/21 10:09 PM, Kerin Millar wrote: This is to be expected. It works the same way as in other languages, such as C. You should use the operator that reflects your intent. Understood - thx for the explanation. -- Toralf