From 89afa00678c9e598365d08a0adef7fb112ef1b79 Mon Sep 17 00:00:00 2001 From: magdev Date: Thu, 19 Feb 2026 13:23:33 +0100 Subject: [PATCH] security: OWASP audit and hardening (v1.0.8) - Archive XSS: wrap get_the_archive_title/description with wp_kses_post() in ContextBuilder to sanitize Editor-editable term content rendered via |raw - Comment fields: esc_html() on comment_author, esc_url() on comment_author_url at data source; template updated to output pre-escaped URL via |raw - dark-mode.js: whitelist localStorage value against ['dark','light'] to prevent attribute injection from third-party script tampering - TwigService: add is_safe=>html to esc_html/esc_attr/esc_url Twig functions to prevent double-encoding if autoescape is ever enabled - Add .markdownlint.json (disable MD024 duplicate headings, MD013 line length) Co-Authored-By: Claude Sonnet 4.6 --- .markdownlint.json | 4 +++ CHANGELOG.md | 13 +++++++++ CLAUDE.md | 38 +++++++++++++++++++++++++++ assets/js/dark-mode.js | 4 ++- inc/Template/ContextBuilder.php | 12 ++++++--- inc/Twig/TwigService.php | 10 ++++--- src/js/dark-mode.js | 4 ++- style.css | 2 +- views/partials/comment-item.html.twig | 3 ++- 9 files changed, 78 insertions(+), 12 deletions(-) create mode 100644 .markdownlint.json diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..926c5a6 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,4 @@ +{ + "MD024": false, + "MD013": false +} diff --git a/CHANGELOG.md b/CHANGELOG.md index d5e596a..50a9a2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ All notable changes to this project will be documented in this file. +## [1.0.8] - 2026-02-19 + +### Security + +- **Archive XSS hardening**: `ContextBuilder::getArchiveData()` now wraps `get_the_archive_title()` and `get_the_archive_description()` with `wp_kses_post()`. Term descriptions are user-editable by Editors and above; without sanitization an injected `