Atomic Edge analysis of CVE-2026-141270: This is an authenticated (Contributor+) stored Cross-Site Scripting vulnerability in the Transliterator plugin for WordPress, affecting versions up to and including 2.5.19. The flaw resides in the `img` shortcode handler within `serbian-transliteration/classes/shortcodes.php`, where the `img_attributes` shortcode attribute is passed through `wp_kses_post()` and then inserted directly into the generated `` tag. Atomic Edge research assigns this a CVSS score of 6.4 (Medium) given the requirement for contributor-level authentication, but the stored nature permits persistent script execution in administrative contexts.
Root Cause: The vulnerability stems from improper neutralization of user-supplied input in the `img` method of the shortcode class. Between lines 377 and 424 of the vulnerable version, the code accepts `img_attributes` from the shortcode attributes array and applies `wp_kses_post()` before injecting it into the HTML attribute context of the `` element. `wp_kses_post()` is designed for post content filtering and permits HTML tags and attributes that are valid in post bodies, but it does not enforce attribute-level escaping for an HTML attribute context. As a result, an attacker can supply attribute values containing event handlers (e.g., `onerror`, `onload`) or other script-bearing attributes that survive `wp_kses_post()` and execute when the image is rendered. The patch introduces a strict allowlist of attributes and explicit escaping per attribute, confirming the root cause is insufficient output escaping and input validation in the attribute insertion path.
Exploitation: An authenticated attacker with contributor or higher privileges creates or edits a post containing the `[img]` shortcode with a crafted `img_attributes` value. For example: `[img src=”x” img_attributes=’onerror=”alert(document.cookie)”‘]`. Because the shortcode attributes are processed on save, the payload is stored in the post content. When any user (including an administrator) views the post, the shortcode renders an `` tag with the `onerror` handler intact, executing the attacker’s JavaScript in the context of the victim’s session. The attack requires the ability to create or edit posts, which contributor-level users possess.
Patch Analysis: The patch (version 2.5.20) completely rewrites the `img` method. It first rejects non-string attribute values and validates the active script against `[‘cyr’, ‘lat’]`. More importantly, it replaces the direct `wp_kses_post($attr->img_attributes)` insertion with a structured parsing approach using `wp_kses_hair()` to extract attribute name/value pairs. Each parsed attribute is checked against an explicit allowlist (`id`, `class`, `title`, `width`, `height`, `loading`, `decoding`, `fetchpriority`, `crossorigin`, `referrerpolicy`, `role`, `tabindex`, `lang`, `dir`, `style`) and a regex for `data-*` and `aria-*` attributes. Restricted attributes receive additional value validation (e.g., numeric for width/height, enumerated values for loading/decoding). Inline styles are sanitized with `safecss_filter_attr()`. Finally, each attribute is escaped with `esc_attr()` and the entire image tag is built with `esc_url()` for the source and `esc_attr()` for the title. This layered approach eliminates the XSS vector by ensuring only safe attributes with validated values are emitted, and all output is contextually escaped.
Impact: Successful exploitation allows an attacker to execute arbitrary JavaScript in the browser of any user who views the compromised page. This can lead to session hijacking, theft of authentication cookies, privilege escalation (e.g., creating administrative accounts via CSRF), content modification, and redirection to malicious sites. Because the payload is stored in post content, it persists until the post is edited or deleted, and it can affect high-privilege users such as administrators reviewing contributed content.







