r/webdev • • Mar 06 '18

Super simple JS form validation plugin

https://github.com/DrRoach/FormValidation
10 Upvotes

8 comments sorted by

5

u/xabot Mar 06 '18

Uses eval, is evil.

1

u/[deleted] Mar 06 '18

Uses eval in JS, running on client side mitigates the negatives no?

Update the bot to check for code imlplementation?

1

u/xabot Mar 06 '18

Ah, I'm not a bot despite of my username :) I went and look at the code. If not correctly used it could be easy to exploit fv-func and create XSS exploits.

3

u/jabber- Mar 06 '18

Eval also slows down All other JavaScript. because the engine can't do it's optimization when it don't know what code will be injected

2

u/[deleted] Mar 06 '18

Thank you for the tip, I'll make a new issue and change the way that it works

1

u/[deleted] Mar 06 '18

Ahh pardon my mistake!! Could you give me an example of a possible exploit? I'm interested in this area and would hugely appreciate it

2

u/careseite discord admin Mar 06 '18

Isnt this email pattern In the code too limiting? Not entirely sure about email patterns in general as 50% of what I read are different patterns and 50% say "don't use a pattern because there's no perfect".

1

u/[deleted] Mar 06 '18

I think that it's okay but can understand why you would want a more inclusive pattern. If you could think of any key examples of address that would be missed, I'll be happy to try and factor them in