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

Careful, this could run arbitrary code in your shell #5

Open
mbdaso opened this issue Aug 26, 2019 · 1 comment
Open

Careful, this could run arbitrary code in your shell #5

mbdaso opened this issue Aug 26, 2019 · 1 comment

Comments

@mbdaso
Copy link

mbdaso commented Aug 26, 2019

If whatthecommit decides to upload a commit message of type $(foo) , a command corresponding with foo will run in your shell.

Example: git commit -m $(rm -rf *)

@lwe
Copy link
Owner

lwe commented Sep 1, 2019

Hi @alu0100832211, can you elaborate a bit? While using whatthecommit is obviously not a sane idea in general. I'm not sure how this could be exploited directly, unless it's possible to cirrucmvent bash. However, I totally agree that you shouldn't paste things or load things directly from the internet(tm).

# to simulate a curl that responds this as a plain text response
function whatthecommit() { echo '$(ls -la)' }

echo "$(whatthecommit)"
# => "$(ls -la)", the second $() is not expanded

Or what am I missing exactly?

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

2 participants