khal accepts events missing the TZOFFSETTO and TZOFFSETFROM properties
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.1k
- Forks
- 233
- Avg merge
- 1h 44m
- Merged PRs (30d)
- 1
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the supplied ICS example and trace khal's import and iCalendar validation entry points. Check how VTIMEZONE STANDARD and DAYLIGHT components are validated, then add coverage showing that missing TZOFFSETTO and TZOFFSETFROM are rejected; the issue is done when malformed imports no longer pass silently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100