No announcement yet.

Invalid rrule & exceptions in CalDAV & export

  • Filter
  • Time
  • Show
Clear All
new posts

  • Invalid rrule & exceptions in CalDAV & export


    I am not sure how it happened, but one of our users has an event with an rrule (extracted from the DB) set to "FREQ=MONTHLY;BYDAY=;BYSETPOS=7;UNTIL=20221207T225 959Z".
    I believe this is an invalid rrule (empty BYDAY). On our instance, we only have CalDAV enabled, so this event was added either via CalDAV, when receiving a mail or via the web interface.

    This invalid rrule is triggering exceptions on the server when trying to export it or when trying to fetch it via CalDAV.
    Here is the exception when trying to export it:
    java.lang.NumberFormatException: For input string: "BYSETP"
    at java.lang.NumberFormatException.forInputString(Num
    at java.lang.Integer.parseInt(
    at java.lang.Integer.parseInt(
    at net.fortuna.ical4j.util.Numbers.parseInt(Numbers.j ava:63)
    at net.fortuna.ical4j.model.WeekDay.<init>(WeekDay.ja va:98)
    at net.fortuna.ical4j.model.WeekDayList.<init>(WeekDa
    at net.fortuna.ical4j.model.Recur.<init>( 30)
    at com.openexchange.chronos.ical.ical4j.mapping.ICalT extMapping.export(
    at com.openexchange.chronos.ical.ical4j.mapping.ICalM apper.exportEvent(
    at com.openexchange.chronos.ical.impl.CalendarExportI mpl.exportEvent(
    at com.openexchange.chronos.ical.impl.CalendarExportI mpl.add(
    at com.openexchange.importexport.exporters.ical.Abstr actICalEventExporter.exportChronosEvents(AbstractI
    at com.openexchange.importexport.exporters.ical.ICalC ompositeEventExporter.exportBatchData(ICalComposit
    at com.openexchange.importexport.exporters.ical.Abstr actICalExporter.getExportDataSource(AbstractICalEx
    at com.openexchange.importexport.exporters.ical.Abstr actICalExporter.exportData(AbstractICalExporter.ja va:137)
    at com.openexchange.importexport.exporters.ICalExport er.exportBatchData(
    at com.openexchange.importexport.actions.exporter.Abs tractExportAction.perform(AbstractExportAction.jav a:92)
    at com.openexchange.importexport.actions.exporter.Abs tractExportAction.perform(AbstractExportAction.jav a:72)
    at com.openexchange.ajax.requesthandler.DefaultDispat cher.doCallAction(
    at com.openexchange.ajax.requesthandler.DefaultDispat cher.callAction(
    at com.openexchange.ajax.requesthandler.DefaultDispat cher.doPerform(
    at com.openexchange.ajax.requesthandler.DefaultDispat cher.perform(
    at com.openexchange.ajax.requesthandler.DispatcherSer vlet.handle(
    at com.openexchange.ajax.requesthandler.DispatcherSer vlet.doPost(
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:706)
    at com.openexchange.ajax.AJAXServlet.doService(AJAXSe

    Which makes sense somehow looking at `public Recur(final String aValue)` in `net.fortuna.ical4j/src/net/fortuna/ical4j/model/`. With a ` StringTokenizer(aValue, ";=")`, when `BYDAY` is matched, `WeekDayList` is called with `BYSETPOS` which clearly is not a valid day.

    This sounds like two bugs to me:
    - Some missing validation somewhere
    - A relatively weak parser in Recur, with an uncaught exception

    I'll try to see if I can identify how that even was created (which validation fails) & reproduce from scratch.
    Please let me know if there is any way of identifying that...

    Thanks in advance,