akshat
akshat

Reputation: 15922

Is there a javascript library which can be used to filter out strings for XSS attacks?

Is there a Javascript equivalent of libraries like HTMLPurifier, which remove XSS code from strings?

Upvotes: 3

Views: 874

Answers (2)

Sergey Ilinsky
Sergey Ilinsky

Reputation: 31535

Google-caja project should help you.

Upvotes: 1

bdonlan
bdonlan

Reputation: 231223

Generally speaking, by the time Javascript code is running, it's too late to protect yourself against an XSS attack. You need to protect against it at the server, not the client.

Upvotes: 7

Related Questions