Tapestry 5
  1. Tapestry 5
  2. TAP5-1057

XSS vulnerability in calendar component

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.1.0.5
    • Fix Version/s: 5.2.0
    • Component/s: tapestry-core
    • Labels:

      Description

      The calendar component provided in tapestry 5.1.0.5 could be used to allow code injection by malicious web users into any page that uses datefield .

      To reproduce the vulnerability, put js code like <script>alert("T5 is great"); </script> in any datefield and click on the related calendar bitma

      After quick search in the DateField.js, it seems like the field value is not escaping

      escaping with a change like var value = escape($F(this.field)); the field value seems solve this vulnerability.

      1. datefield_js.patch
        1 kB
        Nourredine K.
      2. datefield_js.patch
        0.7 kB
        Nourredine K.

        Issue Links

          Activity

          Hide
          Nourredine K. added a comment -

          Hi,

          I encountered this issue. See the simple joined patch.

          Nourredine.

          Show
          Nourredine K. added a comment - Hi, I encountered this issue. See the simple joined patch. Nourredine.
          Hide
          Nourredine K. added a comment -

          Hi,

          A more achieved datefield.js patch (fix for xss vulnerabilities for ajax requests)

          Nourredine.

          Show
          Nourredine K. added a comment - Hi, A more achieved datefield.js patch (fix for xss vulnerabilities for ajax requests) Nourredine.
          Hide
          Igor Drobiazko added a comment -

          Escaping datefield value is inappropriate for localized dates, for example French months décembre or février.

          Show
          Igor Drobiazko added a comment - Escaping datefield value is inappropriate for localized dates, for example French months décembre or février.
          Hide
          Igor Drobiazko added a comment -

          Prototype's String.escapeHTML() fixes the issue. Integration test proves that.

          Show
          Igor Drobiazko added a comment - Prototype's String.escapeHTML() fixes the issue. Integration test proves that.
          Hide
          Christophe Cordenier added a comment -

          I will apply it on 5.1.0.8-SNAPSHOT too

          Show
          Christophe Cordenier added a comment - I will apply it on 5.1.0.8-SNAPSHOT too
          Hide
          Christophe Cordenier added a comment -

          Clone instead re-opening.

          Show
          Christophe Cordenier added a comment - Clone instead re-opening.

            People

            • Assignee:
              Christophe Cordenier
              Reporter:
              François Facon
            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development