Skip to content

isomorphic component (Browser + SSR) for HTML sanitization paired with CSP #41

@nibtime

Description

@nibtime

Motivation

Where is the isomorphic <SafelySetInnerHtml> component? I think this package is a good context to provide this component and pair it with CSP

Idea

HTML Sanitization has two sides: The client-side, that prevents XSS DOM -> Database, and the server-side, that prevents Database -> XSS DOM. The client-side could be implemented with DOMPurify and paired with trusted-types spec, the server-side with sanitize-html and paired with HTML preprocessing of getCspInitialProps (#40).

Resources

https://www.npmjs.com/package/dompurify
https://www.npmjs.com/package/sanitize-html
https://github.com/cure53/DOMPurify#what-about-dompurify-and-trusted-types

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions