Legacy Knowledge Base
Published Jun. 30, 2025

Special character validation for product relation type

Written By

Kanchan Bisht

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • Special Characters should not be allowed.
  • Steps to reproduce:
    1. Navigate to the System Settings -> Catalog -> Product Relations
    2. Add new value as "<script>alert(1);</script>"
    3. Save
    4. Now, go to any product details
    5. Click on Product Relation
    Observed Behavior: It will execute the script and throw errors on the front end.
    Expected Behavior: Special Characters should not be allowed to be saved from the control panel settings itself.

Environment

  • Liferay DXP 7.4
  • Commerce 4.0

Resolution

  • The observed behavior is the known bug of commerce 4.0 and has been addressed in update 83 or above.
    • Please be noted that the new value is saved regardless if it has Special Characters or not, but the input is sanitized, and viewing or adding product relations work as expected.

Additional Information

  • If a hotfix is required, please create a support ticket requesting the hotfix by attaching the patch details and this ticket which addresses this concern. 
  • Installing Fix Packs and Hotfixes on Liferay DXP will guide you to install the Fixpack or Hotfix in your environment.
Did this article resolve your issue ?

Legacy Knowledge Base