Skip to content

Escape the log shown on the settings page's Logging tab - #139

Merged
joaquimds merged 2 commits into
masterfrom
fix-log-viewer-xss
Nov 10, 2026
Merged

joaquimds merged 2 commits into
masterfrom
fix-log-viewer-xss

Conversation

@conatus

@conatus conatus commented Oct 24, 2026

Copy link
Copy Markdown
Member

Fixes JOIN-168.

The Logging tab shows the latest plugin log inside a <pre>, but printed it unescaped. The log holds text visitors send, for example the plan ID from a /join request, so markup sent that way ran in the browser of whichever admin next opened the tab. The fix escapes the log with esc_html(), as the Loggly message just above it already does.

Branched from master, separate from the settings test stack (#133 to #138), so it can go out on its own.

Testing

  • New E2E test tests/log-viewer.spec.ts: posts a /join whose plan ID is an <img onerror>, opens the Logging tab as an admin, and checks the markup is shown as text and never becomes an element or runs. It fails without the fix (the <img> element is created) and passes with it.
  • phpcs passes on the changed file.

Generated by Claude Code

The log holds text sent by visitors (for example the plan ID in a /join
request), and was printed into the page as HTML, so markup in it ran in
the admin's browser. Show it as text instead. JOIN-168.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BL2bFrTk84JMy3CPAsCTV9
@linear-code

linear-code Bot commented Oct 24, 2026

Copy link
Copy Markdown

JOIN-168

esc_html() returns an empty string for any input that is not valid UTF-8,
so one bad byte from a visitor's request blanked the whole Logging tab.
Substitute invalid bytes with U+FFFD instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joaquimds
joaquimds merged commit 459cf80 into master Nov 10, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants