[Security] Parse CalDAV and EWS XML with defusedxml #11

Closed
opened 2026-07-11 12:51:16 +02:00 by zemion · 1 comment
Owner

Bandit flags unsafe XML parsing for CalDAV and EWS responses. These responses are remote/provider-controlled and should use defusedxml.

Classification: immediate local fix.

Report evidence:

  • govoplan-calendar/src/govoplan_calendar/backend/caldav.py:325, :358.
  • govoplan-calendar/src/govoplan_calendar/backend/service.py:1378.
  • Bandit: B314; Ruff: S314.

Suggested next steps:

  • Use defusedxml.ElementTree.fromstring for CalDAV multistatus, discovery multistatus, and EWS item parsing.
  • Add defusedxml>=0.7,<1 to calendar dependencies.
  • Verify parser smoke paths.

Baseline report directory: audit-reports/govoplan-full-20260711-1238

<!-- codex-audit-full-2026-07-11:calendar-xml-defusedxml --> Bandit flags unsafe XML parsing for CalDAV and EWS responses. These responses are remote/provider-controlled and should use defusedxml. Classification: **immediate local fix**. Report evidence: - `govoplan-calendar/src/govoplan_calendar/backend/caldav.py:325`, `:358`. - `govoplan-calendar/src/govoplan_calendar/backend/service.py:1378`. - Bandit: `B314`; Ruff: `S314`. Suggested next steps: - Use `defusedxml.ElementTree.fromstring` for CalDAV multistatus, discovery multistatus, and EWS item parsing. - Add `defusedxml>=0.7,<1` to calendar dependencies. - Verify parser smoke paths. Baseline report directory: `audit-reports/govoplan-full-20260711-1238`
zemion added the
type
bug
priority
p1
status
ready
module/calendar
codex/ready
labels 2026-07-11 12:51:16 +02:00
Author
Owner

Codex state update: Implemented locally: CalDAV and EWS XML parse paths now use defusedxml.ElementTree.fromstring, with defusedxml>=0.7,<1 added to pyproject.toml. Verified with py_compile and parser smoke checks.

Codex state update: Implemented locally: CalDAV and EWS XML parse paths now use `defusedxml.ElementTree.fromstring`, with `defusedxml>=0.7,<1` added to `pyproject.toml`. Verified with py_compile and parser smoke checks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: add-ideas/govoplan-calendar#11
No description provided.