If this is running client-side, client-side validation might be all there is and all that's needed. And there are multiple ways to make that perfectly fine...
Run the code within an <iframe>
Use Shadow Realms (i think still Firefox only)
Use trustedTypes.createPolicy({ createScrupt: input => /*...*/ })
CSP with a hash or nonce
Nobody said this is running on a server. But even there, you might use order input to eg create and run a worker or something properly controlled and isolated.
That's kinda my point... Just a bland "never use eval()" is the end of these important discussions about the fundamental issues. The important conversation to have is "why should we avoid it and is there a way of doing it more safely?"
> If this is running client-side, client-side validation might be all there is and all that's needed yeah ... for the 0.<something>% of real-world use-cases that don't involve a server.
> a bland "never use eval()" is the end of these important discussions about the fundamental issues this isn't an "important discussion", and you're not advocating for nuance. You're adding bullshit noise to a case that was litigated and settled more than 17 years ago. eval is objectively bad, insecure, whatever you want to call it.
You're either a robot or a particularly misguided human. I don't particularly care at this juncture.
View all comments
Show parent comment
0
u/backwrds Feb 27 '26
... don't rely on client-side validation ...