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

Add Ability to Detect RCE Attacks Via Backticks #36

Open
cp1992 opened this issue Feb 5, 2024 · 3 comments
Open

Add Ability to Detect RCE Attacks Via Backticks #36

cp1992 opened this issue Feb 5, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@cp1992
Copy link

cp1992 commented Feb 5, 2024

Problem: Currently the default ruleset includes many of the common keywords/commands that can be used to trigger an RCE attack, e.g. system, eval, exec, and qx. However, it does not provide a solution for executing a system command using the backtick syntax, e.g.

my $cmd = "ls -a $folder" # assume $folder is dynamic/user provided value; if unchecked, could result in RCE attack
my @results = `$cmd`

Is there a way to write a rule or add functionality to allow for zarn to identify and flag this kind of code?

@htrgouvea htrgouvea self-assigned this Feb 5, 2024
@htrgouvea
Copy link
Owner

Hi @cp1992! This is a great question!

At the moment, ZARN looks just for "risks functions" and then checks if some payload can be used to perform an attack. So, in the current structure we cannot create any rules for this use case of Backticks =/ (I'm trying to put more functionality into ZARN and will consider this use case.)

I don't know much about Perl::Critic but it also has some security checks, is it covered for this case?

@htrgouvea htrgouvea added the enhancement New feature or request label Feb 5, 2024
@cp1992
Copy link
Author

cp1992 commented Feb 5, 2024

@htrgouvea Perl::Critic was not able to flag this issue either, in fact it misses many of the issues your tool identifies. If this is something that could be considered for addition that would be awesome! Your tool is very useful and your efforts much appreciated.

@htrgouvea
Copy link
Owner

Thank you @cp1992! Any other suggestions you have, feel free to open more issues or pull requests. Features or ideas for new rules are always welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants