Sanitized parameters for hyprctl dispatch and hyprctl eval #14890
Unanswered
im117
asked this question in
Feature requests - Protocols / Integrations
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The problem
With the Lua syntax for hyprctl commands, it is harder to defend against code injection attacks than with hyprlang. This is because, while we can use the built-in bash input sanitization with the hyprlang config syntax, the hyprctl syntax used with Lua is more complicated. I have the following code for renaming a workspace using a dialog:
I got this code after rewriting a script to do a similar thing with Hyprlang. Unlike the old script, this script has a clear code injection risk. For example, if I put the following value into the Zenity dialog:
", name = (function() hl.exec_cmd("walker"); end)(), name = "The walker command will get executed. The intended behavior is that the workspace gets renamed to the above string.
The old script used with hyprlang for your reference:
The proposed feature
It would be easier for me to implement the new script correctly if I could do something like this. The args array refers to arguments passed after the raw dispatcher code. We could also implement something similar with eval.
Beta Was this translation helpful? Give feedback.
All reactions