HTMXUI is engineered for high-security, regulated, and bank-grade web applications. This document details our Content Security Policy (CSP) Level 3 architecture, declarative Role-Based Access Control (RBAC) model, memory safety guarantees, and vulnerability reporting procedures.
Unlike legacy reactive libraries that rely on new Function(...) or eval(), HTMXUI runs in Strict Zero-Eval mode by default (strictCSP: true):
Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; object-src 'none'; base-uri 'self';- No
unsafe-evalRequired: HTMXUI executes all reactive attributes (hx-state,hx-action,hx-text,hx-show,hx-class,hx-computed) through a hand-crafted, recursive-descent AST parser. - AST Sandboxing: The parser strictly rejects dangerous global access (
window,document,globalThis,eval,Function,constructor,__proto__). - No Dynamic Compilation: Expressions and arrow closures (
reduce,map,filter) are parsed into safe closure trees and evaluated against isolated proxy scopes.
HTMXUI provides first-class, client-side authorization directives (hx-role and hx-can) with reactive signal enforcement:
| Directive | Syntax Example | Behavior |
|---|---|---|
hx-role |
hx-role="admin, compliance" |
Hides element (display: none !important, hidden, aria-hidden="true") if user lacks role. |
hx-role.disable |
hx-role.disable="manager" |
Sets disabled="true", aria-disabled="true", and pointer-events-none opacity-50. |
hx-role.redact |
hx-role.redact="executive" |
Masks innerHTML with [REDACTED — RESTRICTED ACCESS] and sets aria-hidden="true". |
hx-can |
hx-can="trade:execute & !account:freeze" |
Enforces granular verb/resource permissions with & (AND), | (OR), and ! (NOT). |
hx-can.disable |
hx-can.disable="wire:transfer" |
Disables interactive transfer buttons when permission is lacking. |
hx-can.redact |
hx-can.redact="ssn:view" |
Redacts sensitive PII fields. |
Important
Client-side RBAC directives (hx-role / hx-can) manage presentation, UX safety, and accessibility trees. In accordance with banking security standards (FFIEC, PCI-DSS 4.0, SOC2 Type II), all server-side endpoints must independently validate authorization on incoming hypermedia requests (HX-Request).
When an unauthorized element interaction is attempted or blocked:
- Dispatches
htmx:auth-deniedCustomEvent onwindowand target element with{ el, required, type, userRoles, userPermissions }. - Emits structured diagnostic records
@diag HTMXUI-AUTH-001(role violation) and@diag HTMXUI-AUTH-002(permission violation) indiagnosticHistory.
HTMXUI supports hypermedia security synchronization via HTTP headers:
HX-Auth-Roles: admin, compliance, traderHX-Auth-Permissions: trade:execute, account:read, wire:approve
When these headers are received on any HTMX response, HxBolt.auth automatically updates its reactive state, triggering instantaneous DOM-wide re-evaluation of all hx-role and hx-can elements with zero page reload.
- ColumnStore & SparseMatrix Bounds: In-memory analytical searches (
HxFlashColumnStore) and 2D spreadsheet grids (SparseMatrix) operate over explicitFloat64ArrayandInt32Arraybuffers with strict index bounds checks, preventing out-of-bounds reads and memory leaks. - Microtask Batching: Signals and DOM mutations are flushed deterministically using
queueMicrotask, preventing infinite render cycles.
We take security vulnerabilities seriously. If you discover a security issue or vulnerability in HTMXUI, please report it privately:
- Security Team Email:
security@hypermedia.tools(or open a private security advisory on GitHub). - PGP Key ID:
4A8E 91B2 C3F0 7D45 - Response SLA:
- Initial Acknowledgement: Within 24 hours
- Triage & Assessment: Within 48 hours
- Patch Release & Advisory: Within 7 business days
Please do not report security vulnerabilities via public GitHub issues or public discussions.
| Version | Status | Security Support |
|---|---|---|
1.x (Latest) |
Current | ✅ Full Support |
< 1.0 |
Deprecated | ❌ End of Life |