How to find malicious unicode with eslint?

Viewed 65

Unicode in javascript provides a lot of opportunities for malicious developers to insert backdoors or intentional bugs that are easy to slip passed a code-review, a trivial example:

const user = {
  isNormalUser: true,
};
if (!user.isNοrmalUser) {
  console.log("do bad stuff");
}

will print "do bad stuff". Is there a good way to detect this, preferably with eslint?

0 Answers
Related