Skip to content

How to saftey sanitize html content before injection in jquery-pajax? #746

@karthickvTR

Description

@karthickvTR
fire('pjax:beforeReplace', [container.contents, options], {
     state: pjax.state,
     previousState: previousState
   })
   context.html(container.contents)

The content is injected context.html, which can potentially introduce XSS vulnerabilities if the response contains unsafe HTML.

Is there a recommended or built-in way to sanitize the content before it's injected, or do we need to implement our own client-side sanitization (e.g., using Dompurify) outside the library?

Also, are there any plans to include built-in sanitization or hooks for this in future releases?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions