TranslatePress < 2.0.9 - Authenticated Stored Cross-Site Scripting
Description
The TranslatePress WordPress plugin before 2.0.9 does not implement a proper sanitisation on the translated strings. The 'trp_sanitize_string' function only removes script tag with a regex, still allowing other HTML tags and attributes to execute javascript, which could lead to authenticated Stored Cross-Site Scripting issues.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
2- WordPress/TranslatePressdescription
- Range: <2.0.9
Patches
Vulnerability mechanics
Root cause
"The 'trp_sanitize_string' function does not properly sanitize translated strings, allowing HTML and JavaScript execution."
Attack vector
An authenticated attacker can inject malicious JavaScript payloads into translated strings. The 'trp_sanitize_string' function, which is intended to sanitize these strings, only removes script tags using a regular expression. This allows other HTML tags and attributes that can execute JavaScript, such as the `onerror` attribute, to be stored and later executed when the translated content is displayed [ref_id=1]. The vulnerability can be triggered by navigating to the translation editing interface and inputting a payload like `<img src=x onerror=alert(4)>` into a gettext string, then saving it [ref_id=1].
Affected code
The vulnerability lies within the 'trp_sanitize_string' function in the TranslatePress WordPress plugin. This function is responsible for sanitizing translated strings before they are stored in the database. The current implementation uses a regular expression to remove only script tags, leaving other HTML tags and attributes that can execute JavaScript vulnerable.
What the fix does
The patch is not available in the provided information. The advisory indicates that the 'trp_sanitize_string' function only removes script tags, allowing other HTML tags and attributes to execute JavaScript. Proper sanitization should remove or neutralize all potentially harmful HTML and JavaScript code, not just script tags.
Preconditions
- authThe attacker must be authenticated to the WordPress instance.
- inputThe attacker needs to input a malicious payload into a translated string.
Reproduction
1. Go to http://localhost:8888/wordpress/?trp-edit-translation=true 2. Input Gettext String 3. Input the payload such as <img src=x onerror=alert(4)> 4. Save, The payload will be executed. 5. Look on the homepage will be affected.
Generated on Jun 4, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
2- packetstormsecurity.com/files/164306/WordPress-TranslatePress-2.0.8-Cross-Site-Scripting.htmlmitrex_refsource_MISC
- wpscan.com/vulnerability/b87fcc2f-c2eb-4e23-9757-d1c590f26d3fmitrex_refsource_MISC
News mentions
0No linked articles in our index yet.