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 when using eq and when using test in if statements #3131

Open
nitrocode opened this issue Jan 27, 2025 · 2 comments
Open

Arbitrary code when using eq and when using test in if statements #3131

nitrocode opened this issue Jan 27, 2025 · 2 comments

Comments

@nitrocode
Copy link

Ref https://yossarian.net/til/post/some-surprising-code-execution-sources-in-bash/#fnref-source

Is there a way for shellcheck to catch these weaknesses and offer better alternatives?

@wileyhy
Copy link

wileyhy commented Feb 5, 2025 via email

@nitrocode nitrocode changed the title Arbotrary code when using eq and when using test in if statements Arbitrary code when using eq and when using test in if statements Feb 5, 2025
@sideeffect42
Copy link

One possible fix is to write POSIX shell scripts. Good old POSIX test does not support array and thus also doesn't resolve indexes :-)

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

3 participants