Block Pages & HTML Sanitization
Configure responsive block page templates, upload custom HTML designs, SanitizeBlockPageHTML anti-XSS policy, and Trace ID request tracking.
When an inbound request is blocked by IP reputation, ACLs, Bot defense, or the AST semantic engine, CheeseWAF renders a structured block page response. Managed under block_page, templates can be visually previewed, edited, and deployed within the Block Pages view in the Web Console.
Basic Configuration
YAML
Template Lifecycle & Sandboxed Previews
- Built-In Modern Designs: Enumerate built-in response templates via
GET /api/block-pages/templates. - Sandboxed Rendering: Preview custom templates safely in an isolated iframe (
POST /api/block-pages/preview) prior to publishing globally. - Custom HTML Uploads: Call
POST /api/block-pages/uploadto upload custom branding, or revert to defaults viaDELETE /api/block-pages/custom.
HTML Sanitization Standards (SanitizeBlockPageHTML)
To prevent custom block pages from introducing Stored XSS or phishing vectors, CheeseWAF enforces strict sanitization on all custom HTML inputs before persistence:
1. Tag Whitelist
Only safe layout and typographic tags are permitted:
- Structure:
html,head,body,title,main,section,header,footer,div,span - Typography:
h1–h6,p,strong,em,b,i,small,pre,code,br,hr - Lists & Tables:
ul,ol,li,table,thead,tbody,tfoot,tr,th,td - Assets & Style:
a,img,style,meta
2. Active Script & Event Stripping
- Zero Scripts: All
<script>elements and HTML comments are completely removed. - Event Handler Neutralization: Attributes prefixed with
on(e.g.,onclick,onload,onerror) are excised. - Form Action Protection:
formaction,action, andmethodattributes are stripped to prevent credential-harvesting forms. - Redirect Prevention:
<meta>elements only permit thecharsetattribute;http-equiv="refresh"and arbitrary header injections are rejected.
3. CSS Style Sanitization
@importrules inside<style>tags or inlinestyleattributes are stripped.- Risky CSS primitives such as
javascript:,vbscript:,expression(,behavior:, and-moz-bindingare removed.
4. URL Scheme Controls
- The
hrefandsrcattributes are strictly restricted tohttp,https,mailto, andtel. <img>elements additionally support embedded Base64 image payloads (data:image/*;base64,...); arbitrary data URIs are discarded.
Traceability & Operational Guidelines
- Global Trace ID Correlation: Block pages dynamically display a unique request
traceId. When users report false positives, operators can correlate the exact rule evaluation chain under Monitoring & Logs. - Information Leakage Prevention: Custom block templates should avoid revealing backend hostnames, private IPs, or internal technology stacks to external clients.