Skip to content

Fix stored XSS in bs_tcontent and update Bootstrap to 3.4.1 - #84

Merged
Sinetheta merged 5 commits into
masterfrom
fix/tcontent-id-xss
Oct 18, 2026
Merged

Sinetheta merged 5 commits into
masterfrom
fix/tcontent-id-xss

Conversation

@Sinetheta

Copy link
Copy Markdown
Member

Summary

Security patch for 3.4.6, plus some backwards-compatible cleanup.

  • Stored XSS in [bs_tcontent]: the id attribute was output unquoted (id=VALUE). esc_attr() does not encode spaces, so a Contributor could inject extra attributes such as event handlers. The value is now quoted; output for normal ids is unchanged. A regression test is included. Reported privately by a security researcher.
  • Bootstrap 3.3.5 → 3.4.1: 3.3.5 has known XSS issues in tooltip/collapse data attributes (CVE-2018-14040/14041/14042, CVE-2019-8331). WordPress allows data-* in Contributor content and the plugin initialises tooltips page-wide, so these were reachable. 3.4.1 is the final Bootstrap 3 release and a drop-in replacement. The files are unmodified upstream builds and the glyphicon fonts are identical.
  • Editor tab ids with dots (Tab href & tab content ID's get dots added and break the tabs #68): applies the fix from gh-68 Fixed bug with id creation based on time. #69 by @No3x (author preserved on the commit).
  • E2E tests: newer WordPress renamed the TinyMCE "Toolbar Toggle" to "Extended Toolbar", which broke every editor spec. The specs now match either label, and leftover debug code that wrote dom-debug*.html into the repo root is removed.
  • readme.txt changelog entry for 3.4.6.

Fixes #68. Supersedes #69.

Release note

Release as 3.4.6 (npm run release -- 3.4.6). A stray 3.4.5 tag from an earlier aborted release already exists, and WordPress.org currently serves 3.4.4.

Testing

Run locally against WordPress 7.1.3 via wp-env:

  • PHPUnit: 32/32 passing. The new regression test fails on the old code.
  • Playwright: 11/11 passing.

🤖 Generated with Claude Code

Sinetheta and others added 5 commits October 18, 2026 11:15
The id attribute was emitted unquoted (id=VALUE). esc_attr() does not
encode spaces, so a space in the id ended the attribute and let a
Contributor inject arbitrary attributes such as event handlers (stored
XSS). Quoting the value closes the hole; rendered output for normal ids
is unchanged.

Also drops an unused global from bs_dropdown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bootstrap 3.3.5 is affected by CVE-2018-14040, CVE-2018-14041,
CVE-2018-14042 and CVE-2019-8331 (XSS via data-parent, data-target,
data-container and data-template). WordPress allows data-* attributes in
Contributor post content and the plugin initialises tooltips page-wide,
so these were reachable without any shortcode.

3.4.1 is the final Bootstrap 3 release and a drop-in replacement. Files
are the unmodified upstream builds (match the published SRI hashes);
glyphicon fonts are identical between the two versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
event.timeStamp has fractional milliseconds, so ids like
bs_tab1234.567 were produced and the dot broke the tab selector.
Use a short random id instead.

Applied from #69. Fixes #68.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Newer WordPress renamed the TinyMCE "Toolbar Toggle" button to
"Extended Toolbar", so the specs never expanded the row holding the
plugin's buttons and every editor test failed. Match either label.

Also removes leftover debug code that wrote dom-debug*.html files into
the repo root on every run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Sinetheta
Sinetheta merged commit 5674f44 into master Oct 18, 2026
1 check passed
@Sinetheta
Sinetheta deleted the fix/tcontent-id-xss branch October 18, 2026 18:28
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.

Tab href & tab content ID's get dots added and break the tabs

2 participants