You've already forked wp-bootstrap
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 <noreply@anthropic.com>
This commit is contained in:
13
CHANGELOG.md
13
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 `<script>` tag would execute via the `|raw` filter in `archive.html.twig`
|
||||
- **Comment author XSS hardening**: `ContextBuilder::buildCommentTree()` now applies `esc_html()` to `comment_author` and `esc_url()` to `comment_author_url` at the data source, preventing injection via user-supplied comment fields
|
||||
- **Dark mode localStorage whitelist**: `getPreferredTheme()` in `dark-mode.js` now validates the stored theme value against `['dark', 'light']` before use, preventing attribute injection from a tampered localStorage value written by a third-party script
|
||||
- **Twig escaping functions marked safe**: `esc_html()`, `esc_attr()`, and `esc_url()` registered in `TwigService` are now declared with `['is_safe' => ['html']]`, preventing double-encoding if Twig autoescape is ever enabled
|
||||
|
||||
### Changed
|
||||
|
||||
- `views/partials/comment-item.html.twig`: Comment author URL now output via `{{ comment.author_url|raw }}` (escaped in PHP) instead of calling `esc_url()` from the template, keeping escaping logic in one place
|
||||
|
||||
## [1.0.7] - 2026-02-18
|
||||
|
||||
### Added
|
||||
|
||||
Reference in New Issue
Block a user