Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-1934

Kaptcha Component throws NPE after session is expired

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.3.2
    • Fix Version/s: 5.4
    • Component/s: tapestry-kaptcha
    • Labels:

      Description

      A have a page with kaptchaField and Kaptcha image - OK.
      The page is renered under URL e.g. http://localhost:8080/myapp/registration - OK.

      But if the bad user (robot) hit url with http://localhost:8080/myapp/registration.kaptcha:image after the session is expired, NPE it thrown - NOK.

      How to protect the page?

      Caused by: org.apache.tapestry5.runtime.ComponentEventException [at context:Registration.tml, line 24]
      at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.processEventTriggering(ComponentPageElementImpl.java:1130)
      at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$3200(ComponentPageElementImpl.java:61)
      at org.apache.tapestry5.internal.structure.ComponentPageElementImpl$5.invoke(ComponentPageElementImpl.java:1051)
      at org.apache.tapestry5.internal.structure.ComponentPageElementImpl$5.invoke(ComponentPageElementImpl.java:1048)
      at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
      ... 70 more
      Caused by: java.lang.NullPointerException
      at com.google.code.kaptcha.text.impl.DefaultWordRenderer.renderWord(DefaultWordRenderer.java:55)
      at com.google.code.kaptcha.impl.DefaultKaptcha.createImage(DefaultKaptcha.java:43)
      at

      org.apache.tapestry5.kaptcha.internal.services.KaptchaProducerImpl.createImage(KaptchaProducerImpl.java:57)
      at $KaptchaProducer_b9452c5536c8e.createImage(Unknown Source)
      at org.apache.tapestry5.kaptcha.components.KaptchaImage.onImage(KaptchaImage.java:90)
      at org.apache.tapestry5.kaptcha.components.KaptchaImage.dispatchComponentEvent(KaptchaImage.java)
      at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:923)
      at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.processEventTriggering(ComponentPageElementImpl.java:1106)
      ... 74 more

        Attachments

          Activity

            People

            • Assignee:
              hlship Howard M. Lewis Ship
              Reporter:
              petr.charvat Petr Charvát
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: