Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 1.68 KB

README.md

File metadata and controls

39 lines (30 loc) · 1.68 KB

Examples

This module contains worked examples of building and applying sanitizer policies. The sources are meant to be read and adapted; the module is tested as part of the reactor but is not published, so applications should not import org.owasp.html.examples.

Included examples

The eBay and Slashdot programs read UTF-8 HTML from standard input and write sanitized HTML to standard output; each buffers the complete input before sanitizing. UrlTextExample accepts HTML as command-line arguments.

Build and test

The tests exercise both accepted markup and hostile input. With JDK 11 or newer, run them from the repository root so Maven also builds the sanitizer and shim modules:

./mvnw -pl examples -am test

Treat these policies as examples, not universal security profiles. Start from default deny, allow only the markup an application needs, restrict URL protocols explicitly, and add negative tests for the application's threat model. The root README and getting-started guide cover the supported public API.