3 ms·
I love bash scripting, but never knew about the ability to redefine existing commands. It made me think that it could be used maliciously, for example redefinin
by shever73 5y ago
I love bash scripting, but never knew about the ability to redefine existing commands. It made me think that it could be used maliciously, for example redefining cp so that sends a file to a remote server as well as copying it locally.
- barosl 5y agoIt absolutely can be used maliciously, but if an attacker can add an alias to the environment, they might also be able to manipulate PATH, making a malicious cp take precedence over the original cp. So the point is moot.
- avar 5y agoThat's not really a threat model to be concerned about, if someone can define bash aliases for you you're already running their arbitrary code, so them defining bash aliases for you should be the least of your concerns.