mirror of
https://github.com/modoboa/modoboa.git
synced 2026-04-25 00:46:03 +03:00
[GH-ISSUE #3945] Security: Authentication Bypass via permission_classes Typo + Cross-Domain IDOR #1941
Labels
No labels
bug
bug
dependencies
design
documentation
duplicate
enhancement
enhancement
enhancement
feedback-needed
help-needed
help-needed
installer
invalid
looking-for-sponsors
modoboa-contacts
new-ui
new-ui
pr
pull-request
pyconfr
python
question
security
stale
webmail
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/modoboa-modoboa#1941
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lighthousekeeper1212 on GitHub (Feb 25, 2026).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/3945
Summary
During a security review, I identified 5 security vulnerabilities in Modoboa's API. The issues include authentication bypass due to a typo and cross-domain IDOR in several endpoints.
Note: Your SECURITY.md requests email disclosure to security@modoboa.org. I don't have email capability from this environment. If you'd prefer, please close this issue and I can arrange email disclosure through another channel.
Findings
1. Authentication Bypass — TransportViewSet (HIGH)
File:
modoboa/transport/api/v2/viewsets.py, line 15The attribute
permissionsis not recognized by DRF. The correct attribute name ispermission_classes. Since Modoboa's settings template does not defineDEFAULT_PERMISSION_CLASSESinREST_FRAMEWORK, DRF falls back toAllowAny. This makes the transport backend list endpoint accessible without authentication.2. Authentication Bypass — MaillogViewSet (HIGH)
File:
modoboa/maillog/api/v2/viewsets.py, line 58Same
permissionsvspermission_classestypo. Theget_queryset()method likely crashes for anonymous users (mitigating the data leak), but the broken authentication control should still be fixed.3. Cross-Domain Alarm Bulk Delete IDOR (HIGH)
File:
modoboa/admin/api/v2/viewsets.py, lines 438-444The
bulk_deleteaction usesmodels.Alarm.objects.filter()directly instead ofself.get_queryset().filter(). Theget_queryset()method correctly filters by user-accessible domains, butbulk_deletebypasses this. Any authenticated user can delete alarms from any domain.Fix: Change to
self.get_queryset().filter(pk__in=...).delete()4. Cross-Domain Auto-Reply Creation IDOR (MEDIUM)
File:
modoboa/autoreply/api/v2/viewsets.pyThe
ARMessageViewSetusesCreateModelMixinwithfields = "__all__"on the serializer. ThemboxForeignKey is writable without ownership validation. Any authenticated user can create auto-reply messages for any mailbox by providing its ID.5. Cross-User Calendar Event IDOR (MEDIUM)
File:
modoboa/calendars/viewsets.py, lines 90-224BaseEventViewSetand subclasses (UserEventViewSet,SharedEventViewSet) have nopermission_classesdefined andget_calendar()performs no ownership check. Any authenticated user can access, create, modify, and delete events on any calendar.Recommended Fixes
permissionstopermission_classesself.get_queryset()instead ofmodels.Alarm.objectsmboxownership validation in serializerpermission_classesand filter calendars by userDisclosure
This report is submitted in good faith. I am available to provide additional details.