Khan / Khan/live-editor

eval function callable

Open
#759 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
776
Forks
180
PR merge metrics
No merged PRs in 30d

Description

If I type
```js
println(eval("2 + 2"))
```
Oh Noes say Eval can be Harmful.
But if type
```js
a = eval
println(a("2 + 2"))
```
Then I get out 4. So clearly I can use eval without an error which is a BIG PROBLEM.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing both snippets in the live editor and locate the code that restricts direct eval calls. Trace how assigning eval to a variable bypasses that restriction. Done means the direct and aliased forms are handled consistently, with tests covering both examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.