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

Improve TypeScript/JS code evaluation security #67

Open
Dhaiwat10 opened this issue Sep 29, 2021 · 6 comments
Open

Improve TypeScript/JS code evaluation security #67

Dhaiwat10 opened this issue Sep 29, 2021 · 6 comments

Comments

@Dhaiwat10
Copy link
Contributor

Is your feature request related to a problem? Please describe.
We are currently using eval to run the code. People strongly recommend against using it, though: Why is using the JavaScript eval function a bad idea?

Describe the solution you'd like
@jsjoeio has linked some great resources and proposed an interesting solution here: #39. quickjs-emscripten is the one that interests us the most.

We can adapt this approach for TS, too because what we are ultimately doing is running JS code.

@Rohithgilla12
Copy link

@kennethcassel I want to give it a try :D

@kennethcassel
Copy link
Contributor

Go for it @Rohithgilla12!

@Rohithgilla12
Copy link

I tried
https://github.com/maple3142/wasm-jseval and quickjs-emscripten but not able to succeed, it would be great if anyone can help where to use what.
Thanks

@Dhaiwat10
Copy link
Contributor Author

@Rohithgilla12
Copy link

@Rohithgilla12 here: https://github.com/slipHQ/run-wasm/blob/main/src/RunWasmClient.ts#L109

Okay should I install the quickjs library using npm?

@Dhaiwat10
Copy link
Contributor Author

We're using Yarn as our package manager so you should do yarn add <pkg> instead of npm i <pkg>.

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

No branches or pull requests

3 participants