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

Loading worker modules should check permissions #4744

Closed
bartlomieju opened this issue Apr 14, 2020 · 0 comments · Fixed by #5011
Closed

Loading worker modules should check permissions #4744

bartlomieju opened this issue Apr 14, 2020 · 0 comments · Fixed by #5011
Assignees
Labels
bug Something isn't working correctly high priority

Comments

@bartlomieju
Copy link
Member

bartlomieju commented Apr 14, 2020

It turns out that when creating worker using new Worker("./path/to/module", ...); API there is no permissions check for modules loaded. Workers are much like dynamic imports (await import(...)) so similarly proper permissions should be checked when loading worker modules.

The problem we're facing is that TS compiler doesn't check permissions when op_fetch_source_file is called - so effectively it is priviledged, which is related bug at #4383.

Another problem I thought of is that there's no permission hooks in SourceFileFetcher; it handles redirects "transparently", ie. returning source code after resolving all redirect - permissions should be checked before performing any IO.

This is a bug that needs to be fixed before 1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly high priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant