beyondgrep / ack2

**ack 2 is no longer being maintained. ack 3 is the latest version.**
https://github.com/beyondgrep/ack3/
Other
1.48k stars 138 forks source link

Security vulnerability from project .ackrc files #399

Closed jimrandomh closed 10 years ago

jimrandomh commented 10 years ago

Running "ack" in a directory which contains a malicious .ackrc will cause code execution. This is similar to the old Unix issue where if you put "." on your path, you can be tricked into running something named "ls": an attacker might scatter .ackrc files in different locations. It's not a huge risk, but it seems worth fixing.

The problem is the --pager option: a .ackrc file could say "--pager=./malicious.sh" (or even "--pager=./.ackrc"). The solution would be to forbid that option (and maybe also --output=expr?) in project ackrc files (but still allow it in other places).

petdance commented 10 years ago

The list of flags to forbid anywhere except your local .ackrc or command line: --pager, --regex and --output.

petdance commented 10 years ago

ack 2.12 has been release that disallows --pager, --regex and --output in project .ackrcs.

xtaran commented 10 years ago

The CVE ID "CVE-2013-7069" has been assigned to this issue.

petdance commented 10 years ago

@jimrandomh: Thank you very much for bringing this to my attention.

I have put up a security alert at http://beyondgrep.com/security/