Skip to content

v4.0.0 — correctness release

Choose a tag to compare

@PhilflowIO PhilflowIO released this 15 Aug 06:39
· 489 commits to main since this release
b9b398b

A correctness release. Several tools returned confidently wrong answers or accepted input that produced invalid objects on the server. The fixes change behaviour, hence the major version.

Install: npm install dav-mcp@4.0.0

Breaking

  • update_event no longer takes dates through fields. DTSTART, DTEND and DURATION are rejected there — use the new top-level start_date, end_date and all_day parameters. The flat map cannot express this property family: an all-day value needs a VALUE=DATE parameter, which the map could only add as a duplicate property, and writing DTEND on an event stored as DTSTART + DURATION left both present, which RFC 5545 §3.6.1 forbids.
  • The fields map now validates keys and values on update_event, update_todo and update_contact. Keys must be bare property names, values single-line.
  • Query tools return at most 20 results by default. calendar_query, todo_query and addressbook_query previously returned everything in range. Pass limit (max 500); the response states how many matched in total.

Security

An unvalidated fields map allowed iCalendar/vCard property and component injection. Keys and values reached updatePropertyWithValue unchecked, and that function keys on the property name alone — so a value could terminate the VEVENT and open a second, fully caller-shaped one, a key containing : or a line break injected properties outright, and a VALARM with ACTION:EMAIL and an arbitrary attendee could be attached. Verified by re-parsing the emitted documents. This is reachable through ordinary tool arguments, which matters because the caller is a model that routinely handles untrusted text.

Also: carriage returns survived sanitizeICalString, and create_event / create_contact emitted LF line endings where CRLF is required.

Fixed

  • Recurring events showed the series start, not the occurrence in the queried range. "What's on next week" returned each series once, dated at its original start — often years back. Present with a wrong date is worse than absent. Expansion is client-side, so it does not depend on a server implementing CALDAV:expand, and it also surfaces RECURRENCE-ID overrides, which were silently dropped.
  • Times were rendered in the server's timezone, not the event's. A meeting booked for 14:00 Berlin showed as 12:00 on a UTC host; an Exchange-style TZID made the date vanish entirely; date-only values shifted a day east of Greenwich.
  • Deletes reported success even when the server refused them. fetch does not reject on 4xx and the Response was discarded, so a 403 looked exactly like a 204. Server-independent, contrary to the original Radicale framing.
  • Contact photos overflowed the context. One contact with an embedded PHOTO produced ~171k characters, 99.9% of it base64 in the raw data block. Against a real address book: 456k characters of raw cards now render in 8.9k.
  • client.fetchTodos is not a function. The tsdav fork's committed dist/ had lost the whole VTODO surface to an upstream sync and a git install never rebuilt it, so six of the eight todo tools were dead for npm users while working locally.
  • [object Object] as the collection name, across five call sites plus a null path.
  • The tool-call logger and dotenv could corrupt the JSON-RPC stream by writing to stdout under the stdio transport.
  • The version reported to clients was a hardcoded 3.0.1 in five places, two releases stale.

Added

  • freebusy_query — "when am I free?", calculated client-side, since the native CalDAV free-busy-query REPORT fails on most servers people actually run.
  • All-day events in create_event and update_event, in both directions.
  • limit on the query tools, with the result set sorted before truncation so the subset is the earliest rather than arbitrary.

Internal

Tests went from 76 to 240, including the first formatter, handler, protocol and timezone coverage. The suite runs under host timezones from Pacific/Midway to Pacific/Auckland, which is where the date-shifting bugs hid.

Verified against a live Baïkal server before release.