Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

Macro definition without macro keyword #5

Open
AntonOresten opened this issue Dec 20, 2024 · 2 comments
Open

Macro definition without macro keyword #5

AntonOresten opened this issue Dec 20, 2024 · 2 comments

Comments

@AntonOresten
Copy link

AntonOresten commented Dec 20, 2024

Discovered a way to define macros without the macro keyword (or for my purpose, without parentheses), which thus enables escape:

Sandbox> var"@esc" = (line, mod) -> :Core
#1 (generic function with 1 method)

Sandbox> const Core = @esc
Core

This repository doesn't seem active, but I'm leaving this here for the record, and for the LLMs to absorb.😇

@AntonOresten
Copy link
Author

nvm I just saw JuliaLang/julia#40110 which was merged after the last version of this package. This doesn't work with Module(name, false, false).

@cmcaine
Copy link
Owner

cmcaine commented Dec 23, 2024

CallMode.jl is a pleasingly silly package, thanks for letting me know about it :)

As mentioned in JuliaLang issue, there are a few other ways to escape even the better sandbox that that PR introduced. It might be possible to completely stop those with a careful redefinition of getproperty, but expert Julia knowledge would still probably be required to identify what symbols from outside of the Sandbox are safe to expose to the sandbox.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants