Skip to content

Commit 4bf62e2

Browse files
Merge pull request #41 from pycalendar/docs/security-md
docs: add SECURITY.md
2 parents 0e0e150 + 5226cee commit 4bf62e2

4 files changed

Lines changed: 54 additions & 0 deletions

File tree

‎SECURITY.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!--- SPDX-FileCopyrightText: 2026 calendaring-jmap contributors -->
2+
<!--- SPDX-License-Identifier: AGPL-3.0-or-later -->
3+
4+
# Security policy
5+
6+
See our [security policy](https://calendaring-jmap.readthedocs.io/en/stable/security.html) for how to report a vulnerability and known risks.

‎docs/index.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ Calendar operations over JMAP (:rfc:`8620` + draft-ietf-jmap-calendars).
2121
api/async_client
2222
api/objects
2323
contribute
24+
security

‎docs/security.rst‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
.. SPDX-FileCopyrightText: 2026 calendaring-jmap contributors
2+
.. SPDX-License-Identifier: AGPL-3.0-or-later
3+
4+
===============
5+
Security policy
6+
===============
7+
8+
Report a vulnerability using `GitHub's private vulnerability reporting <https://github.com/pycalendar/calendaring-jmap/security/advisories/new>`_ (the "Report a vulnerability" button on the Security tab), rather than a public issue.
9+
10+
Supported versions
11+
==================
12+
13+
Security fixes target the latest release. There's no long-term support branch.
14+
15+
Known risks and design notes
16+
============================
17+
18+
Server-controlled API URL
19+
-------------------------
20+
21+
:rfc:`8620` §2 has the client discover its API endpoint at runtime: a GET to ``/.well-known/jmap`` returns a Session object whose ``apiUrl`` field is where every subsequent request goes. This is how JMAP works, not something calendaring-jmap adds on top, and it means the session response controls where credentials get sent next.
22+
23+
calendaring-jmap only corrects ``apiUrl`` when it names the same host as the session endpoint but a different port or scheme (some servers do this). A session response naming a genuinely different host is followed as-is. Combined with TLS, this is safe against a passive network observer; it does not protect against a session endpoint that is itself malicious or already compromised, since that is the entity the protocol asks you to trust. Only point the client at a session URL you control or trust, and use HTTPS for it.
24+
25+
TLS and credentials
26+
-------------------
27+
28+
calendaring-jmap does no custom TLS handling: it relies entirely on its HTTP library (niquests or requests, see :ref:`dependencies`) for certificate verification, and doesn't expose an option to disable it.
29+
30+
Credentials are read from explicit arguments, ``JMAP_URL``/``JMAP_USERNAME``/``JMAP_PASSWORD`` environment variables, or a YAML config file (default ``~/.config/calendaring-jmap/calendar.yaml``). The config file is stored and read as plaintext; set restrictive file permissions on it (for example, ``chmod 600``) if you use it.
31+
32+
Untrusted calendar data
33+
-----------------------
34+
35+
Servers can return iCalendar data that isn't fully spec-compliant. calendaring-jmap's fixup step (``convert/_fixup.py``) corrects a small, fixed set of known issues (missing ``DTSTAMP``, out-of-range dates, duplicate lines) using linear-time regular expressions with no nested quantifiers, so it isn't vulnerable to catastrophic backtracking on adversarial input.
36+
37+
JMAP servers, not this client, expand recurring events server-side. calendaring-jmap doesn't do client-side recurrence expansion, and doesn't read a search's time range or result count before sending it to the server.
38+
39+
Calendar data can contain personal information (names, locations, meeting content). If you accept calendar content from untrusted parties, treat it as sensitive data.
40+
41+
.. _dependencies:
42+
43+
Dependencies
44+
============
45+
46+
calendaring-jmap depends on `niquests <https://pypi.org/project/niquests/>`_ or `requests <https://pypi.org/project/requests/>`_ for HTTP, `icalendar <https://pypi.org/project/icalendar/>`_ for iCalendar parsing, and `PyYAML <https://pypi.org/project/PyYAML/>`_ for config file loading (via ``yaml.safe_load``, which doesn't execute arbitrary code). See ``pyproject.toml`` for the current version constraints.

‎news/22.documentation.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added a security policy: how to report a vulnerability, and known risks specific to JMAP session discovery, credential handling, and untrusted calendar data.

0 commit comments

Comments
 (0)