Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safety #98

Open
edemaine opened this issue Oct 1, 2022 · 0 comments
Open

Safety #98

edemaine opened this issue Oct 1, 2022 · 0 comments

Comments

@edemaine
Copy link
Owner

edemaine commented Oct 1, 2022

We might want to protect loading of certain NodeJS functionality, unless a command-line argument says otherwise. This could be similar to LaTeX's -shell-escape and openin_any/openout_any (see e.g. this).

When we're rewriting modules via Babel, we might override require to prevent using node:fs or fs. (I'm sure there are lists of other dangerous modules too.) Or rewrite that module to exclude writing files, or to check whether written files are in the same directory or outside.

We don't want to limit custom code, and I've definitely used fs to read (but not write) .svg files in the past (but this is now much easier via require). But we can limit the damage that the code might do (hopefully accidentally).

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

No branches or pull requests

1 participant