Skip to content

khal accepts events missing the TZOFFSETTO and TZOFFSETFROM properties #967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ghost opened this issue Oct 18, 2020 · 3 comments
Open

Comments

@ghost
Copy link

ghost commented Oct 18, 2020

Ave,

Thank you for your awesome work on khal!

It appears that khal does not sufficiently validate ICS files it is asked to import: in particular it does not verify for the presence of the tzoffsetto and tzoffsetfrom properties in the "STANDARD" and "DAYLIGHT" subcomponents of the "VTIMEZONE" component. This allows for importing events that will then break other clients after synchronization (e.g. Davx⁵).

It will also accept events without a PRODID, silently adding itself as a PRODID. I don't think that's a problem, but I just thought I'd mention it too.

Example accepted file (slimmed down from a real-world ICS offered by some random website):

BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
BEGIN:VTIMEZONE
TZID:Europe/Zurich
BEGIN:STANDARD
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
DTSTART:19810329T020000
END:STANDARD
BEGIN:DAYLIGHT
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
DTSTART:19810329T020000
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
CLASS:PUBLIC
CREATED:20200908T142600
DTEND;TZID=Europe/Zurich:20201029T221500
DTSTAMP;TZID=Europe/Zurich:20200908T142600
DTSTART;TZID=Europe/Zurich:20201029T204500
TRANSP:OPAQUE
UID:25b2ac7d-0ec9-43f2-91ba-ac869838f922
END:VEVENT
END:VCALENDAR

iCalendar validator output:

Missing required PRODID property near line # 1
Reference: RFC 5545 3.6. Calendar Components
Missing required TZOFFSETTO property near line # 6
Reference: RFC 5545 3.6.5. Time Zone Component
Missing required TZOFFSETFROM property near line # 6
Reference: RFC 5545 3.6.5. Time Zone Component
Missing required TZOFFSETTO property near line # 10
Reference: RFC 5545 3.6.5. Time Zone Component
Missing required TZOFFSETFROM property near line # 10
Reference: RFC 5545 3.6.5. Time Zone Component

OS/Distribuiton: GNU/Linux, Arch Linux
Khal version: khal, version 0.10.2
Vdirsyncer version: vdirsyncer, version 0.16.9.dev0+gb5dd092.d20200713

Please ask if I can provide any additional useful information.

@ephase
Copy link
Contributor

ephase commented Oct 19, 2020

Hi @Phenitei and thank you for your report.

I read the rfc5545 and all is not so clear for me but I'll try to figure out how TZOFFSETFROM and TZOFFSETTO` work.If someone have some documentation...

@geier
Copy link
Member

geier commented May 12, 2021

Those VTIMEZONEs are definitively broken. The issue is, we are not parsing them at all, but icalendar (the library khal uses for handling icalendar files) looks at the TZID first and if it knows them, uses the known TZ information instead.

What we could do, is build in an additional validator and at least throw a warning when a broken .ics file is being imported.

@Phenitei Did you use the import command for importing those .ics files?

@ghost
Copy link
Author

ghost commented May 13, 2021

@geier Thank you for your answer :)

Yes, I have used the import command. It would indeed make sense to validate the file recieved as an input; though this seems to be a problem with the icalendar library then - it should not accept an invalid file, even if it recognizes the TZID. I'll open an issue there too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants