All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased]
[2.2.0] - 2026-11-05
Security
kses()now filters executable markup with its default config. Previously the default$config = 1ran htmLawed with no filtering, so<script>,on*event handlers andjavascript:URLs survived and{!! kses( $html ) !!}was open to stored XSS. The default is nowSecurity::KSES_SAFE_CONFIG(htmLawed safe mode, no<style>,<link>or<meta>elements, noon*orstyleattributes);javascript:anddata:URLs are rewritten todenied:…. Behavior change: callers that relied on the permissive default must now pass their own$config.sanitize()/BaseFormRequestwith thehtmlrule and the opt-inXssProtectionmiddleware pick up the same default. Passing any config other than1is forwarded unchanged (#52, #53).- The default
kses()config also removes elements that can restyle or hijack the page:<base>,<form>and form controls (<input>,<button>,<select>,<option>,<optgroup>,<textarea>,<datalist>,<keygen>,<isindex>) and frames (<frame>,<frameset>), which allowed fake login forms on the site's own origin. URLs are limited tohttp/https, plusmailtoandtelforhref; any other scheme (ftp:,file:, …) is rewritten todenied:…. Relative and fragment URLs are kept. Custom (hyphenated) elements are now dropped (their text is kept) and thepingattribute is denied: htmLawed let custom elements keep every attribute, so Alpine/Livewire directives such as<x-a x-data x-init="…">survivedkses()and ran as script. Custom element names returned byap.security.ksesAllowedTagsare ignored for the same reason. The default also removesclassattributes (so content can't borrow the site's CSS classes for a full-page phishing overlay) and Alpine/Livewire directive attributes (x-*,@*,:*,wire:*) andison every element, even when$specpermits them. It dropsrel="opener"and addsnoopenerto links with atarget(reverse tabnabbing), and prefixesid/namevalues withuser-content-(DOM clobbering).#fragmentlinks and ID references (usemap,headers,for,aria-labelledby, …) are rewritten to match, and sanitizing already-prefixed output again leaves it unchanged. New publicSecurity::KSES_ID_PREFIXandSecurity::ksesSafeTag()(thehook_taginKSES_SAFE_CONFIG). Behavior change: content that relied on forms or other URL schemes passing throughkses()must pass its own$config(#50). - Under the default config, IDs stay unique after the
user-content-prefix is added: a repeatedidor one containing whitespace is dropped. Uniqueness is checked perkses()call (htmLawed'sunique_idsis off inKSES_SAFE_CONFIG), so sanitizing content again, or sanitizing two fragments that share an ID, no longer strips IDs. Before this, htmLawed remembered IDs across calls, so a third pass or a second call dropped theidand broke#fragmentlinks.itemrefvalues are now prefixed too. - Under the default config,
$speccan no longer re-enableon*,style,classorpingattributes (htmLawed lets$specoverridedeny_attribute). Those entries are dropped before the spec reaches htmLawed (#52). - Tags returned by the
ap.security.ksesAllowedTagsfilter can no longer re-enablescript,style,link,meta,base,iframe,frame,frameset,object,embed,applet,audio,video,canvas,dialog, or forms and form controls. Entries are trimmed and lowercased, and anything that isn't a plain element name (wildcards, htmLawed+/-operators, comma lists, non-strings) is ignored. The safe attribute and URL rules also apply to the filtered list (#50, #52).
Added
- The release workflow now has a
sync-docsjob that queues documentation and changelog imports on docs.artisanpackui.dev after each release. It needs theDOCS_API_TOKENorg secret and skips with a notice when the secret isn't set. Both imports are attempted on every run, and the job fails unless each returns202. Set aDOCS_PACKAGE_SLUGrepository variable if the docs-site slug ever differs from the repo name. The Packagist update now runs in its own job, so a Packagist failure no longer blocks the docs import, and the workflow defaults to read-onlyGITHUB_TOKENpermissions (#51). - New HTML filtering guide covering the safe
kses()default, narrowing elements withap.security.ksesAllowedTags,$specand custom configs, plus an "Upgrading to 2.2" section in UPGRADE.md. The API reference now documentsSecurity::KSES_SAFE_CONFIG,Security::KSES_ID_PREFIXandSecurity::ksesSafeTag().
Changed
- The
XssProtectionmiddleware no longer filters the input keys listed in the newartisanpack.security.xss.exceptconfig (password,password_confirmationandcurrent_passwordby default), at any nesting depth. With the stricterkses()default, filtering passwords could stop existing credentials from matching their hashes. - The release workflow's docs import requests now time out after 30 seconds, so a stalled
import-docscall can't stopimport-changelogfrom running. - The security report generator's
generatorVersionmetadata now reports2.2.0. - The global
kses()helper now accepts and forwards$configand$speclikeSecurity::kses(). Previously it silently dropped them (#52).
Fixed
- Bundled htmLawed: safe mode no longer throws on
styleattributes containingurl(…)(thehl_urlcallback didn't resolve in the namespaced copy). Corruptedsrcset/archive/itemtypeandabs_urlcode paths are repaired, and$specstrings now parse on every call instead of failing on the namespacedhl_aux1/hl_aux2callbacks.srcsetvalues are no longer run throughhl_url()a second time (which double-converted the first candidate underabs_url). A$specdefaultnow goes through the same checks as an input value (values the spec only filtered aren't re-checked): eachsrcsetcandidate gets the scheme check, and astyledefault gets the CSSurl()andexpressionchecks.srcsetvalues are split into candidates per the HTML parsing rules, so commas inside a URL (such as adata:URL) no longer split it. Astyleattribute generated from deprecated markup (<center>,<font>,align,bgcolor, …) is dropped whendeny_attributeor a$spec-stylerule deniesstyle. An integerunique_idsconfig value no longer throws aTypeError(#52, #53).
[2.1.0] - 2026-07-21
Added
- Extension hooks powered by
artisanpack-ui/hooks(^1.2):ap.security.sanitizedInputfilter — wraps everySecurity::sanitize*return with(mixed $value, string $type, mixed $original).ap.security.escapedOutputfilter — wraps everySecurity::esc*return with(string $value, string $context, string $original).ap.security.ksesAllowedTagsfilter — receives(array $allowedTags)fromSecurity::kses(); a non-empty return overrides htmLawed's element whitelist for the call.ap.security.csp.directivesfilter — fires insideCspPolicyService::getPolicy()with(array $directives, Request $request), letting host apps mutate the directive array before it is serialized.ap.security.csp.violationHandledaction — fires at the end ofCspViolationHandler::handle()on stored violations with(CspViolationReport $report).- See the README "Hooks" section for full payload details and examples.
Fixed
Security::sanitizeFloat()was declared to returnfloatbut returned the rawnumber_format()string, which raised aTypeErrorunderstrict_types=1any time the method was actually called. The result is now explicitly cast tofloatbefore return.
[2.0.2] - 2026-06-09
Added
- Laravel 13 support. Widened the
illuminate/supportconstraint to^10.0|^11.0|^12.0|^13.0. Existing Laravel 10/11/12 users are unaffected; Laravel 13 is only selectable on PHP 8.3+ per its own framework constraint.
Changed
- Widened
orchestra/testbenchdev requirement to^10.2|^11.0so package tests can install against Laravel 13. - Swept the package through Laravel Pint to bring it back in line with the configured code style (no behavioral changes).
[2.0.1] - 2026-05-21
Fixed
- Restore the
csp:testcommand (CspTest) to the distributed package. An over-broadexport-ignorerule (/src/**/*Test.php) stripped it from the release tarball, soSecurityServiceProviderregistered a class that wasn't shipped — causingTarget class [ArtisanPackUI\Security\Console\Commands\CspTest] does not existduring package discovery for every consumer.
[2.0.0] - 2026-05-18
Changed
- Promotes the
2.0.0-alpha.1feature surface to the stable2.0.0release. No code changes from the alpha — see the alpha entry below for the complete 2.0 changelog.
[2.0.0-alpha.1] - 2026-05-09
Changed
- BREAKING: Repackaged from monolithic security toolkit into a focused core package plus sibling packages. Authentication, 2FA, RBAC, secure uploads, security analytics, and compliance now live in their own packages. See UPGRADE.md for the full migration guide.
Added
- Content Security Policy subsystem: nonce generator, policy service, policy builder, three presets (
Strict,Relaxed,Livewire), violation reporting endpoint,csp-dashboardLivewire component, and Artisan commands (csp:test,csp:stats,csp:prune,csp:generate). - Security testing toolkit: OWASP / header / dependency / configuration scanners, penetration attack simulator (SQL, XSS, CSRF, path traversal, auth bypass, injection), report generators (JSON, HTML, JUnit, SARIF, Markdown), benchmark suite, security gate, and GitHub Actions integration.
- Security audit Artisan commands:
security:audit,security:scan,security:baseline,security:benchmark,security:check-config,security:test-headers,security:scan-deps,security:clear-rate-limits. CspFacade alongside the existingSecurityFacade.@csp_nonceBlade directive and<x-csp-nonce>component.- Named rate limiters driven from config (
web,api,login,password_reset).
Removed
- Authentication, 2FA, password complexity, account lockout, advanced sessions → moved to
artisanpack-ui/security-auth. - WebAuthn / FIDO2, SSO, social auth, biometric, device fingerprinting → moved to
artisanpack-ui/security-advanced-auth. - Roles, permissions, Blade directives, Gate integration → moved to
artisanpack-ui/rbac. - Secure file uploads, validation, malware scanning → moved to
artisanpack-ui/secure-uploads. - Security event logging, anomaly detection, SIEM export, incident response → moved to
artisanpack-ui/security-analytics. - GDPR / CCPA / LGPD compliance toolkit → moved to
artisanpack-ui/compliance.
[1.0.3] - 2025-05-14
Changed
- Renamed vendor to ArtisanPack UI.
[1.0.2] - 2025-04-21
Fixed
- Issue with the
kses()function.
Added
- Tests and a GitLab pipeline.
[1.0.1] - 2025-04-20
Removed
- Unnecessary files from the published package.
[1.0.0] - 2025-04-17
Added
- Initial release.

