Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-62215

antisamy-markup-formatter-plugin v2.0 filters input fields from uno-choice plugin

      With Active Choices and OWASP Markup Formatter Plugin v2.0 installed, "input" elements are being stripped from "Formatted HTML" parameters.  This is not an issue with OWASP Markup Formatter Plugin v1.8.  Since this is one of the main use-cases of the Active Choices plugin, I assume this is a bug.  There also doesn't seem to be a way to configure the markup formatter that the Active Choices plugin uses.

       

      Attached are screenshots of the parameter config, the working "input" field with v1.8, and the missing input field with v2.0.

        1. parameter-config.png
          parameter-config.png
          267 kB
        2. markup-formatter-1.8.png
          markup-formatter-1.8.png
          28 kB
        3. markup-formatter-2.0.png
          markup-formatter-2.0.png
          28 kB
        4. bruno-screenshot-1.png
          bruno-screenshot-1.png
          66 kB
        5. bruno-screenshot-2.png
          bruno-screenshot-2.png
          127 kB
        6. bruno-screenshot-3.png
          bruno-screenshot-3.png
          93 kB

          [JENKINS-62215] antisamy-markup-formatter-plugin v2.0 filters input fields from uno-choice plugin

          Andrew Potter created issue -

          Thanks for the report and for the taking your time to provide detailed description and screenshots.

          We were preparing a release for the next days (waiting till pending pull request gets reviewed/tested by other maintainers). I will try to include some time to take a look and try to reproduce/fix this one.

          Bruno

          Bruno P. Kinoshita added a comment - Thanks for the report and for the taking your time to provide detailed description and screenshots. We were preparing a release for the next days (waiting till pending pull request gets reviewed/tested by other maintainers). I will try to include some time to take a look and try to reproduce/fix this one. Bruno

          apottere first I would upgrade Active Choices to the latest release.

           

          I have used antisamy-markup-formatter v2.0 successfully with Active Choices v2.2.3 on Jenkins LTS v2.222.1

          Please, make sure that in Jenkins 'Configure Global Security' the Markup Formatter option is set to 'Safe HTML' Hope this helps.

          Ioannis Moutsatsos added a comment - apottere first I would upgrade Active Choices to the latest release.   I have used antisamy-markup-formatter v2.0 successfully with Active Choices v2.2.3 on Jenkins LTS v2.222.1 Please, make sure that in Jenkins 'Configure Global Security' the Markup Formatter option is set to 'Safe HTML' Hope this helps.

          Andrew Potter added a comment - - edited

          ioannis The issue occurs whether the Markup Formatter option is set to Plain Text or Safe HTML.

           

          I wasn't able to find version 2.2.3 of the Active choices plugin, either in GitHub Releases (https://github.com/jenkinsci/active-choices-plugin/releases) or the update site (https://updates.jenkins.io/download/plugins/uno-choice/).  From the README (https://github.com/jenkinsci/active-choices-plugin#version-23-2020) it looks like 2.3 is the next pending version.

          Andrew Potter added a comment - - edited ioannis The issue occurs whether the Markup Formatter option is set to Plain Text or Safe HTML .   I wasn't able to find version 2.2.3 of the Active choices plugin, either in GitHub Releases ( https://github.com/jenkinsci/active-choices-plugin/releases)  or the update site ( https://updates.jenkins.io/download/plugins/uno-choice/) .  From the README ( https://github.com/jenkinsci/active-choices-plugin#version-23-2020 ) it looks like 2.3 is the next pending version.

          apottere It's possible that I have an intermediate AC snapshot as I usually do some testing before final release. Nonetheless, I seriously doubt that the issue will turn out to be active choices itself. You seem to have isolated the issue to the antisamy-markup-formatter-plugin v2.0, but all I'm saying is that this version works for me and my (rather permissive Jenkins instance)

          I use the following Jenkins startup parameters that you may also want to test. I suspect that the CustomJellyContext may be of special interest here

          -Dhudson.model.DirectoryBrowserSupport.CSP= -Dorg.kohsuke.stapler.jelly.CustomJellyContext.escapeByDefault="false"

          Ioannis Moutsatsos added a comment - apottere It's possible that I have an intermediate AC snapshot as I usually do some testing before final release. Nonetheless, I seriously doubt that the issue will turn out to be active choices itself. You seem to have isolated the issue to the antisamy-markup-formatter-plugin v2.0, but all I'm saying is that this version works for me and my (rather permissive Jenkins instance) I use the following Jenkins startup parameters that you may also want to test. I suspect that the CustomJellyContext may be of special interest here -Dhudson.model.DirectoryBrowserSupport.CSP= -Dorg.kohsuke.stapler.jelly.CustomJellyContext.escapeByDefault= " false "

          Andrew Potter added a comment -

          ioannis sorry, must have missed the email for your comment.  I created a git repo with a run script, the current versions of both plugins, and the java opts you specify.  When I run it, the input field is not displayed.

           

          https://github.com/apottere/JENKINS-62215

           

          I also included ".bak" versions of both plugins, which are the older (working) versions.  Let me know if you get different results.

          Andrew Potter added a comment - ioannis sorry, must have missed the email for your comment.  I created a git repo with a run script, the current versions of both plugins, and the java opts you specify.  When I run it, the input field is not displayed.   https://github.com/apottere/JENKINS-62215   I also included ".bak" versions of both plugins, which are the older (working) versions.  Let me know if you get different results.

          Andrew Potter added a comment -

          It looks like this was an intentional change in the markup-formatter plugin: https://github.com/jenkinsci/antisamy-markup-formatter-plugin/pull/12

          It really seems like there's no way you should be able to see `input` fields with any version of the Active Choices plugin after that markup formatter update.  Either this issue should be fixed or the docs for Active Choices should be updated to make it clear that using form fields is no longer an option with the groovy sandbox (and the corresponding sanitation).

          Andrew Potter added a comment - It looks like this was an intentional change in the markup-formatter plugin:  https://github.com/jenkinsci/antisamy-markup-formatter-plugin/pull/12 It really seems like there's no way you should be able to see `input` fields with any version of the Active Choices plugin after that markup formatter update.  Either this issue should be fixed or the docs for Active Choices should be updated to make it clear that using form fields is no longer an option with the groovy sandbox (and the corresponding sanitation).
          Bruno P. Kinoshita made changes -
          Attachment New: bruno-screenshot-1.png [ 51775 ]
          Bruno P. Kinoshita made changes -
          Attachment New: bruno-screenshot-2.png [ 51776 ]
          Bruno P. Kinoshita made changes -
          Attachment New: bruno-screenshot-3.png [ 51777 ]

            kinow Bruno P. Kinoshita
            apottere Andrew Potter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: