Prevent XSS Vulnerability on JSON file (Ajax data source (objects))

Prevent XSS Vulnerability on JSON file (Ajax data source (objects))

Alex67000Alex67000 Posts: 39Questions: 6Answers: 0
edited November 2022 in DataTables 1.10

My JSON file is generated by a form where everyone can inject HTML or Javascript.

Then it's read by Datatables.

How do I prevent Datatables, to output HTML and JS in the table after reading the JSON file (objects.json)?

    $(document).ready(function () {
    var table = $('#lfg').DataTable({
        ajax: 'objects.json',
    // ...

Replies

Sign In or Register to comment.