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

arbitrary code execution via environment variables #104

Open
llua opened this issue Jan 6, 2025 · 0 comments
Open

arbitrary code execution via environment variables #104

llua opened this issue Jan 6, 2025 · 0 comments

Comments

@llua
Copy link

llua commented Jan 6, 2025

eval export HIPRIODST=$HIPRIODST;
# shellcheck disable=SC2086
eval export COMMONOPTIONS=$COMMONOPTIONS;
# shellcheck disable=SC2086
eval export NOPRIOHOSTSRC=$NOPRIOHOSTSRC;
# shellcheck disable=SC2086
eval export NOPRIOHOSTDST=$NOPRIOHOSTDST;
# shellcheck disable=SC2086
eval export NOPRIOPORTSRC=$NOPRIOPORTSRC;
# shellcheck disable=SC2086
eval export NOPRIOPORTDST=$NOPRIOPORTDST;

The above lines allow for code injection[0], which i am unsure is desired.

a minimal reproducer:

F='abc; bash' bash -c 'eval export F=$F; echo exiting'
[user@host ~]$ exit
exiting

[0] http://mywiki.wooledge.org/BashFAQ/048

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

1 participant