Članci s tagom #xss
-
PHP template engine without Twig: production caching and @directive preprocessing
Shinobi Apps framework template engine: DirectiveProcessor processes @csrf/@include/@asset before template execution. @csrf returns PHP code (not static HTML) — nonce evaluated at runtime, never baked into cache file. processExpressions {{ $x }} → htmlspecialchars runtime echo, {!! $x !!} → raw (unescaped) — prior bug: inlined value into cache = stored RCE via {!! SVG }}. Cache keyed by source path hash, not request vars. CSP nonce via Request::getCurrent()->getNonce().
-
Content Security Policy in PHP: the nonce approach that actually works
A strict CSP with per-request nonces, no 'unsafe-inline', and no X-XSS-Protection (which causes more bugs than it prevents). How we handle dynamic styling in a CSP-compliant way: CSS custom properties via setProperty() instead of inline style attributes.