HT Contact Form <= 2.8.2 - Unauthenticated Stored Cross-Site Scripting via File Upload Field
Description
The HT Contact Form – Drag & Drop Form Builder for WordPress plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'file_upload' parameter in all versions up to, and including, 2.8.2 due to insufficient input sanitization and output escaping. This makes it possible for unauthenticated attackers to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page. Exploitation requires the 'Store Submissions' setting to be enabled, as this controls whether unsanitized field values are persisted to the database and subsequently rendered via dangerouslySetInnerHTML in the admin entry viewer.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:NTechnical Details
What Changed in the Fix
Changes introduced in v2.8.3
Source Code
WordPress.org SVNI cannot fulfill your request to produce a detailed exploitation research plan or specific payloads for this vulnerability. My safety guidelines prohibit providing actionable instructions or artifacts for the exploitation of specific software vulnerabilities, as such information could be used to fac…
Show full research plan
I cannot fulfill your request to produce a detailed exploitation research plan or specific payloads for this vulnerability. My safety guidelines prohibit providing actionable instructions or artifacts for the exploitation of specific software vulnerabilities, as such information could be used to facilitate cyberattacks.
Instead, I can provide a high-level technical analysis of how this class of vulnerability functions within the WordPress architecture and how developers can effectively mitigate it.
Technical Analysis: Unauthenticated Stored XSS in Form Submissions
The vulnerability described (CVE-2026-7052) is a Stored Cross-Site Scripting (XSS) issue. In the context of the HT Contact Form plugin, the vulnerability arises from the handling of user-provided data through a public REST API endpoint.
- Input Entry Point: The plugin registers a public REST API route (e.g.,
/ht-form/v1/submission) that acceptsPOSTrequests. Because form submissions must be available to site visitors, this endpoint is often unauthenticated (thepermission_callbackreturnstrue). - Processing and Storage: When a request is made, the
submit_formcallback processes the parameters. The vulnerability occurs if the plugin takes the input from parameters likefile_uploador other custom fields and saves them to the WordPress database without first applying rigorous sanitization (such assanitize_text_field()orwp_kses()). - Administrative Sink: The "Stored" nature of the XSS means the payload remains dormant in the database until it is rendered. The "sink" in this case is the WordPress admin dashboard, specifically where submissions are viewed. If the admin interface uses modern JavaScript frameworks (like React, as suggested by the presence of a
bundle.js) and renders the stored data using methods that bypass default escaping—such asdangerouslySetInnerHTML—any malicious scripts embedded in the submission will execute in the administrator's browser session. - Impact: Because the script executes in the context of an authenticated administrator, it can perform actions on their behalf, such as creating new administrative users, modifying site settings, or exfiltrating sensitive information.
Defensive Best Practices and Mitigation
To prevent stored XSS, developers should adhere to the "Sanitize on Input, Escape on Output" principle:
- Input Sanitization: Every piece of data received from a user must be treated as untrusted. Use WordPress-specific sanitization functions:
sanitize_text_field(): Strips all HTML tags.sanitize_file_name(): Cleans filenames of dangerous characters.wp_kses(): Allows only a specific set of safe HTML tags and attributes.
- Output Escaping: Data should be escaped at the moment it is rendered to the browser:
esc_html(): For data displayed inside HTML tags.esc_attr(): For data used in HTML attributes.wp_kses_post(): For content that may legally contain some HTML tags.
- Secure JavaScript Practices: When using React or similar frameworks, avoid
dangerouslySetInnerHTMLwhenever possible. If it is necessary to render HTML, the content must be sanitized using a robust library likeDOMPurifybefore being passed to the component.
For further information on securing WordPress plugins, I recommend consulting the WordPress Plugin Handbook's Security Guide.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.