You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the comment on the line 80 says, the currently used blacklist approach is dangerous. There are many other symbols (e.g. backtick, ampersand etc) and symbol sequences (e.g "$()") that can be used to perform OS command injection attacks. For example using "127.0.0.1 && /bin/cat /etc/shadow" as the host parameter value in /plugins/juci-diagnostics/rpc/diagnostics.lua causes displaying the shadow file contents.
Recommendation: consider using whitelist based approach instead of a blacklist. In case any of the arguments contain a symbol that is not in a specified whitelist, drop all arguments and raise an error.
The text was updated successfully, but these errors were encountered:
Sounds fair. I do not like the whole idea of passing userdata to shell
commands myself. It is just so useful at times to be able to write shell
oneliners in lua scripts before processing output that this is allowed
using this shell method but I want all such things to go through this
single function where we do proper escaping of all the special symbols.
As the comment on the line 80 says, the currently used blacklist approach
is dangerous. There are many other symbols (e.g. backtick, ampersand etc)
and symbol sequences (e.g "$()") that can be used to perform OS command
injection attacks. For example using "127.0.0.1 && /bin/cat /etc/shadow" as
the host parameter value in /plugins/juci-diagnostics/rpc/diagnostics.lua
causes displaying the shadow file contents.
Recommendation: consider using whitelist based approach instead of a
blacklist. In case any of the arguments contain a symbol that is not in a
specified whitelist, drop all arguments and raise an error.
As the comment on the line 80 says, the currently used blacklist approach is dangerous. There are many other symbols (e.g. backtick, ampersand etc) and symbol sequences (e.g "$()") that can be used to perform OS command injection attacks. For example using "127.0.0.1 && /bin/cat /etc/shadow" as the host parameter value in /plugins/juci-diagnostics/rpc/diagnostics.lua causes displaying the shadow file contents.
Recommendation: consider using whitelist based approach instead of a blacklist. In case any of the arguments contain a symbol that is not in a specified whitelist, drop all arguments and raise an error.
The text was updated successfully, but these errors were encountered: