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

external script, nasty characters & argument injection #158

Open
FranckSallet opened this issue Sep 27, 2024 · 3 comments
Open

external script, nasty characters & argument injection #158

FranckSallet opened this issue Sep 27, 2024 · 3 comments

Comments

@FranckSallet
Copy link

hello

i defined a command in "[/settings/external scripts/scripts]" section that uses a binary check-ping.exe

check_ping = bin/check-ping.exe /host '$ARG1$'

I set the parameter "allow nasty characters" to false for in the category "[/settings/external scripts]"

but i can pass this kind of command:

./check_nrpe -H X.X.X.X -c check_ping -a "google.fr' || echo coucou ||'''"
coucou

Can you check if the option "allow nasty characters" is fonctionnal for external script ?

Regards

@sni
Copy link
Contributor

sni commented Sep 28, 2024

actually the nrpe server uses it's own settings for those things, ex.:

[/settings/NRPE/server]
allow nasty characters = false
allow arguments = true

then it works as expected.

/usr/lib/nagios/plugins/check_nrpe -H localhost -c check_ping -a "google.fr' || echo coucou ||'''"
Exception processing request: Request contained illegal characters (check the allow nasty characters option).

So check your nrpe section to see what's configured there. Right now the settings from [/settings/external scripts/scripts] are not used for nrpe.

@FranckSallet
Copy link
Author

thanks for the reply, it works.

so in what context does the "allow nasty characters" work in the "[/settings/external scripts/scripts]" section ?

Thanks

@sni
Copy link
Contributor

sni commented Oct 1, 2024

right now probably not at all. But might be a good idea to use them together with the settings from the NRPE/Web section.

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