Closed VincentGuinaudeau closed 6 months ago
this is great work! thank you.
Thanks for the review, I made all the requested changes.
Also, I noticed that I broke the quine cheating, because it too use the $SUBSCRIPT$
intermediate representation. So I modified every place where it is injected to add the seclevel
.
Also, I noticed that I broke the quine cheating, because it too use the
$SUBSCRIPT$
intermediate representation. So I modified every place where it is injected to add theseclevel
.
Woops. That's my fault for poor design. As this project grows in complexity, we will need to switch from using hardcoded names.
ty
Instead of using the ambient
secLevel
, this PR makes it so that each call to a subscript keeps thesecLevel
specified in the source.This makes depending on other scripts more secure, since we can specify a higher
secLevel
than our script for any particular subscript call, and hackmud will enforce thissecLevel
at runtime.When multiple calls are merged into one, this PR choose the highest
secLevel
, for security. This might cause issues if differentsecLevel
are used to call the same script, with a genuine use case if the subscript is expect to changesecLevel
and you want your script to react accordingly, but this seems far fetched to me.I tested this PR on my own scripts, with subscript call in the main function, in the global scope, in other functions in the same file, and in other files imported via the
esm
syntax.