Magento2: Checkout Agreement Magento 2.2.8, HTML is displayed instead of interpreted

Created on 15 Apr 2019  路  15Comments  路  Source: magento/magento2


If the content for the checkbox of the checkout terms and conditions contains HTML, then HTML code will be displayed instead of being interpreted. Iin earlier magento versions html was interpreted.

Preconditions (*)

  1. Magento 2.2.8
  2. NGINX

Steps to reproduce (*)

  1. Stores > Terms and Conditions > Add a new condition
  2. Fill out the fields, and type at "Checkbox Text" a content with html like: "Some HTML Link"

Expected result (*)

  1. HTML Content at the checkout agreements is interpreted ( in earlier magento versions html was interpreted)

Actual result (*)

  1. HTML is displayed at the checkout agreements
    Screenshot_1
Format is valid non-issue

Most helpful comment

@Webroju: just for some extra info, the reason why this was changed in Magento 2.2.8 is probably because a security issue was found and fixed.
See https://magento.com/security/patches/magento-2.3.1-2.2.8-and-2.1.17-security-update (search for PRODSECBUG-2184).

All 15 comments

Hi @Webroju. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • [ ] Summary of the issue
  • [ ] Information on your environment
  • [ ] Steps to reproduce
  • [ ] Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@Webroju do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • [ ] yes
  • [ ] no

Hi @shikhamis11. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

  • [x] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
  • [x] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • [ ] 6. Add label Issue: Confirmed once verification is complete.

  • [ ] 7. Make sure that automatic system confirms that report has been added to the backlog.

@magento-engcom-team give me 2.2-develop instance

Hi @shikhamis11. Thank you for your request. I'm working on Magento 2.2-develop instance for you

Hi @shikhamis11, here is your Magento instance.
Admin access: https://i-22350-2-2-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@Webroju while creating terms and conditions the field name Checkbox Text is clear that it would be Text so in that reference this is not bug. I will take opinion from maintainers also about this issue.

@shikhamis11 I understand what you mean, but the knockout.js say it has to interpreted as html, or I'm wrong?
Screenshot_2

@Webroju as I said since the label already explained that it is text for terms and conditions so it will not be converted. It seems it is expected behaviour.

the current behavior is not legal in Germany, because if I want to integrate certain terms & conditions in the contract, I have to link to the document, it would be nice if you reconsider your position.

@Webroju you can add your html content inside the content field . while click on the Checkbox Text the content section will be opened in popup where you can add your details

Ok this is not nice, but it will work. Thanks for your help!

@Webroju: just for some extra info, the reason why this was changed in Magento 2.2.8 is probably because a security issue was found and fixed.
See https://magento.com/security/patches/magento-2.3.1-2.2.8-and-2.1.17-security-update (search for PRODSECBUG-2184).

@hostep: Thanks for the info.

According to their own bounty program Cross-Site Scripting (XSS) bugs in the admin interface (URLs containing /admin/) where the code is only executed in front-end context but not in admin context. Merchants are explicitly allowed to use active content when designing their stores, so this is a required feature. The admin XSS capability does not give the administrator any additional powers to do harm beyond what other administrative features already allow. XSS issues where an administrator with limited access can impact other administration pages are valid.

Therefore the ability to add HTML to something that's output on the front-end of the site is not a security concern. Whilst I agree with @hostep that it was probably the attempt to fix PRODSECBUG-2184 that led to this "break", it's not a valid reason to remove the "feature".

@pocallaghan Have you got any chance to revert it back ?

Was this page helpful?
0 / 5 - 0 ratings