Last active
June 26, 2018 19:53
-
-
Save nikolayemrikh/70fdd6000abfa747b238a7f2ae034ff8 to your computer and use it in GitHub Desktop.
Bypass strict mode with Indirect eval call!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function vu () { | |
| "use strict"; | |
| eval('var a = 1;'); | |
| console.log(a); | |
| } | |
| vu(); // Uncaught ReferenceError: a is not defined | |
| function fu () { | |
| "use strict"; | |
| (1,eval)('var b = 1;') | |
| console.log(b) | |
| } | |
| fu(); // 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment