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
I’m pretty new to gptscript and have a question about safely executing commands with sys.exec (or similar features). Is there a built-in way to:
Whitelist Commands:
Allow only specific commands to be executed, either by binary name (e.g., ls) or absolute path (e.g., /bin/ls)?
Raise an error or ignore commands that are not explicitly allowed?
Filter Unsafe Input:
Prevent execution of inputs containing special shell symbols like \``, |, $, ;, or &&`, which could spawn additional processes?
For example, how would the library handle inputs like ls -al $(pwd) or echo $(rm -rf /) or ls -al `pwd` etc.?
Can users provide a custom validation or sanitization function for input arguments to enforce stricter security?
Safety Guarantees:
Are there existing mechanisms in the library to ensure these concerns are handled safely, or would these need to be implemented by the user?
Context
I want to ensure that commands executed through the library are secure and controlled, particularly in scenarios where user-provided input is involved.
Running commands through firejail or something like that could also make sense to have a completely controlled environment (at least on linux).
Any guidance on how to approach this would be greatly appreciated. Thanks for creating such an awesome tool!
The text was updated successfully, but these errors were encountered:
Question
I’m pretty new to gptscript and have a question about safely executing commands with
sys.exec
(or similar features). Is there a built-in way to:Whitelist Commands:
ls
) or absolute path (e.g.,/bin/ls
)?Filter Unsafe Input:
\``,
|,
$,
;, or
&&`, which could spawn additional processes?ls -al $(pwd)
orecho $(rm -rf /)
or ls -al `pwd` etc.?Safety Guarantees:
Context
I want to ensure that commands executed through the library are secure and controlled, particularly in scenarios where user-provided input is involved.
Running commands through firejail or something like that could also make sense to have a completely controlled environment (at least on linux).
Any guidance on how to approach this would be greatly appreciated. Thanks for creating such an awesome tool!
The text was updated successfully, but these errors were encountered: