Skip to content

Fix CVE-2025-48316: Stored XSS vulnerability (v1.6.7)#9

Open
3L1AS wants to merge 1 commit into
ItayXD:masterfrom
3L1AS:fix/cve-2025-48316-stored-xss
Open

Fix CVE-2025-48316: Stored XSS vulnerability (v1.6.7)#9
3L1AS wants to merge 1 commit into
ItayXD:masterfrom
3L1AS:fix/cve-2025-48316-stored-xss

Conversation

@3L1AS

@3L1AS 3L1AS commented Jun 11, 2026

Copy link
Copy Markdown

Security Fix: CVE-2025-48316 — Stored XSS

Vulnerability

CVE-2025-48316: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting) allows Stored XSS via the tooltip shortcode. Affects all versions through 1.6.6.

Attack Chain

Any user with posting privileges (including contributors) could inject malicious JavaScript:

  1. Attacker creates a post with: [tooltip tip="<img src=x onerror=alert(1)>"]text[/tooltip]
  2. PHP shortcode outputs: <abbr title='<img src=x onerror=alert(1)>' rel='tooltip'>text</abbr>
    (esc_attr() encodes for the attribute context, but the data is still stored)
  3. JS reads: tip = target.attr('title') — jQuery auto-decodes HTML entities back to raw HTML
  4. JS injects: tooltip.html(tip) — injects <img onerror> into the DOM → XSS executes

What Changed

File Change
responsive-tooltip.php Added wp_kses_post() to $tip and $content before output — strips <script>, event handlers (onerror, onload), javascript: URLs, while preserving safe formatting HTML
responsive-tooltip-tinyMCE.js Escape "&quot;, ]&#93;, [&#91; in dialog inputs to prevent shortcode attribute breakout
responsive-tooltip-admin-page.php Added wp_strip_all_tags() to CSS textarea input before writing to file
readme.txt Version bump to 1.6.7

Why This Fixes It

The wp_kses_post() call strips dangerous HTML at render time, before the content reaches the page. Even if malicious content is stored in the database, it is sanitized before output. After jQuery decodes the title attribute and .html() injects it, only safe formatting tags (<b>, <i>, <em>, <strong>, <br>) remain.

Backward Compatibility

  • Safe HTML formatting (<b>, <i>, <em>, <strong>, <br>) is preserved — the plugin's HTML formatting feature continues to work
  • No changes to the shortcode API or public-facing behavior
  • Only dangerous HTML (<script>, event handlers, javascript: URLs) is stripped

References

- Sanitize  and  with wp_kses_post() before output to
  prevent injection of dangerous HTML (script tags, event handlers)
- Escape TinyMCE dialog inputs to prevent shortcode attribute breakout
- Sanitize admin CSS textarea with wp_strip_all_tags()
- Bump version to 1.6.7

The Stored XSS vulnerability allowed any user with posting privileges
to inject malicious JavaScript via tooltip shortcode attributes. The
attack chain: shortcode attribute -> esc_attr() (encodes for title
attribute) -> jQuery .attr('title') (decodes back) -> .html(tip)
(injects raw HTML into DOM -> script execution).

Fix: Apply wp_kses_post() server-side to strip dangerous tags before
the content reaches the HTML output, breaking the exploit chain.
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.

1 participant