Template actually comes from an index.html file from the same directory. Context can contain user input.
const context = { id: 1 };
const template = '<html><body>${id}</body></html>';
with (context) {
return eval(`\`${template}\``);
}
I know about XSS protection.
I'm looking for examples of how to break this solution, is there any way a user input can run backend code?