require_tls only enforced on RFC 6764 discovery, not on explicit URLs
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 62/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- python
- Lĩnh vực
- documentation
Hướng nghiên cứu
Đọc tài liệu về require_tls và docstring của constructor trong DAVClient và AsyncDAVClient; issue không nêu tên tệp cụ thể. Làm rõ rằng tùy chọn hiện áp dụng cho quá trình khám phá RFC 6764, không áp dụng cho các URL được cung cấp tường minh, và việc thực thi trên toàn cục được hoãn đến phiên bản 4.0. Công việc được xem là hoàn tất khi phạm vi được ghi trong tài liệu khớp với hành vi hiện tại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
require_tls was added together with the .well-known forwarding, as one out of two measures to prevent a man-in-the-middle-attack. However, something went wrong because in the current main the configuration option is not checked anywhere. In the current v3.3.0-dev branch and future v3.3.0-release there is a fix which will honor this variable but only for well-known forwarding. I think this is silly, it should be for all connections.
Now True is and should be the default. If doing this for all connections, it will be a breaking change - so it's procrastinated until the 4.0-release.
I was too lazy to create this issue myself, so below is the initial text from Claude.
⚠️ This issue is AI-generated (Claude Opus 4.8 via Claude Code) on behalf of tobixen ⚠️
Summary
require_tls is named and documented as if it guarantees a TLS-only connection, but it currently only gates the RFC 6764 discovery path. When a fully-qualified URL is passed explicitly, the parameter has no effect.
Current behaviour (v3.3.x)
The parameter is threaded only through discovery:
DAVClient.__init__ / AsyncDAVClient.__init__ → _auto_url(require_tls=...) → discover_caldav(require_tls=...) → discover_service (where d6267c78 closed the well-known-redirect hole).
But _auto_url returns early for any URL containing /, so discovery — and therefore the require_tls check — is skipped entirely. Result:
# require_tls=True is the DEFAULT, yet this connects over plaintext:
DAVClient(url="http://caldav.example.com/dav/", username=..., password=...)
A parameter literally named require_tls does not require TLS for the connection actually made. This is a name/behaviour mismatch and a potential downgrade footgun.
Proposed fix (deferred to 4.0)
Make enforcement global rather than discovery-only:
- Add a shared
BaseDAVClient._enforce_require_tls(url)helper (there is no shared__init__today — the two constructors are separate). - Call it from both
DAVClient.__init__andAsyncDAVClient.__init__right after URL objectification, rejecting non-httpsURLs whenrequire_tls=True. - Update docstrings + CHANGELOG.
Why this is deferred (breaking change)
require_tls defaults to True. Making it global would reject every explicitly-passed http:// URL by default, which breaks real usage:
- The project's own docker integration test servers (Cyrus, SOGo, Baikal, …) are all
http://localhost:PORT/.... - Anyone running an internal/LAN CalDAV server over plain HTTP with default args.
So this changes the default security posture and is a breaking change — appropriate for a major release (4.0), with require_tls=False threaded through the test config.
Out of scope for the constructor check
A constructor-time scheme check does not catch an https → http downgrade via redirect during live requests. If "applies to any connection" is taken literally, the per-request path in each client needs enforcement too — worth tracking separately.
Decision
For now: keep require_tls discovery-only and document the scope precisely (done alongside this issue). Revisit global enforcement in 4.0.
⚠️ This issue is AI-generated (Claude Opus 4.8 via Claude Code) on behalf of tobixen ⚠️
- Ngôn ngữ chính
- Python
- Star
- 412
- Fork
- 113
- Merge trung bình
- 22 giờ 43 phút
- Pull request đã merge (30 ngày)
- 43
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của python-caldav/caldav
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
python-caldav/caldav#782 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
python-caldav/caldav#780 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
compatibility refactoring
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 32/100
python-caldav/caldav#778 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Support for ical objectsĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 18/100
python-caldav/caldav#777 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
python-caldav/caldav#774 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của python-caldav/caldav
Issue tương tự
-
docs: the dev-setup table and AGENTS.md name the reviewed_by guard that CI's Changelog job runsĐang mởarea: tools documentation good first issue ready for a contributor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
eyalgolan/statecraft-israel#873 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add cover art to song rowsĐang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 5 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày