Skip Navigation

[Resolved] sanitize data – disallowing HTML elements

This support ticket is created 2 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 2 years, 6 months ago.

Assisted by: Waqar.

Author
Posts
#2418193

we ran a pen test on our site and found that a user can submit a Test<script>console.log(5)</script> via a form field. below are all the details. We are trying to find a way to prevent any html tags from being summited
--------------
Some of the data entered in these forms was rendered by the dashboard area of the application at the following URL:

hidden link
The company information pages also rendered various inputs that were entered in these forms. An example of a company information page that was generated during the assessment was:

hidden link
Both of these areas of the application were vulnerable to cross-site scripting because they failed to properly encode or sanitise field contents prior to rendering.

As a proof-of-concept, Rootshell submitted the following in the hidden field named input_21 of the first form ("General Business Questions"):

Test<script>console.log(5)</script>
After submitting this request and visiting the dashboard at the "smes-listing" URL, the number 5 was written to the JavaScript console, demonstrating that the injected JavaScript was rendered and executed by the web browser.

#2419615

Hi,

Thank you for contacting us and I'd be happy to assist.

I've performed some tests on my website with Toolset Forms and it automatically excludes the script tags (<script> & </script>), from the form's processing as well as from the data saved in the database. The tests covered the post title, single line, multiple lines, WYSIWYG, and hidden generic fields.

Can you please check if this report is for the forms added using the Toolset Forms? I tried to view those forms, but, it seems you need to be logged in to access them.

The field naming convention "input_21" suggests that it could be a form from the Gravity Form plugin. In that case, it would be best to consult and report this to their official support team.

regards,
Waqar