zulip/zerver/tests
Mateusz Mandera 8d2d64c100 CVE-2020-14215: Fix validation in PreregistrationUser queries.
The most import change here is the one in maybe_send_to_registration
codepath, as the insufficient validation there could lead to fetching
an expired PreregistrationUser that was invited as an administrator
admin even years ago, leading to this registration ending up in the
new user being a realm administrator.

Combined with the buggy migration in
0198_preregistrationuser_invited_as.py, this led to users incorrectly
joining as organizations administrators by accident.  But even without
that bug, this issue could have allowed a user who was invited as an
administrator but then had that invitation expire and then joined via
social authentication incorrectly join as an organization administrator.

The second change is in ConfirmationEmailWorker, where this wasn't a
security problem, but if the server was stopped for long enough, with
some invites to send out email for in the queue, then after starting it
up again, the queue worker would send out emails for invites that
had already expired.
2020-06-16 23:35:39 -07:00
..
fixtures markdown: Add support for spoilers. 2020-06-16 16:14:10 -07:00
images emoji: Only resize custom emoji that need it. 2019-01-29 10:33:50 -08:00
__init__.py Fix missing zerver/tests/__init__.py. 2016-04-11 22:34:22 -07:00
test_alert_words.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_archive.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_attachments.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_audit_log.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_auth_backends.py CVE-2020-14215: Fix validation in PreregistrationUser queries. 2020-06-16 23:35:39 -07:00
test_bots.py python: Manually convert more percent-formatting to f-strings. 2020-06-14 23:27:22 -07:00
test_bugdown.py python: Manually convert more percent-formatting to f-strings. 2020-06-14 23:27:22 -07:00
test_cache.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_camo.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_compatibility.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_create_video_call.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_custom_profile_data.py python: Manually convert more percent-formatting to f-strings. 2020-06-14 23:27:22 -07:00
test_decorators.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_digest.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_docs.py python: Guard against default value mutation with read-only types. 2020-06-13 15:31:27 -07:00
test_email_change.py confirmation: Pass realm rather than host to confirmation_url. 2020-06-14 23:27:22 -07:00
test_email_log.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_email_mirror.py email-mirror-postfix: Handle 8-bit messages correctly. 2020-06-14 20:24:06 -07:00
test_email_notifications.py email: Migrate to new Python ≥ 3.3 email API. 2020-06-14 20:24:06 -07:00
test_embedded_bot_system.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_event_queue.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_events.py realm: Remove Google Hangouts integration. 2020-06-16 17:02:27 -07:00
test_external.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_gitter_importer.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_hipchat_importer.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_home.py realm: Remove Google Hangouts integration. 2020-06-16 17:02:27 -07:00
test_hotspots.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_i18n.py python: Convert more percent formatting to Python 3.6 f-strings. 2020-06-14 23:27:22 -07:00
test_import_export.py python: Manually convert more percent-formatting to f-strings. 2020-06-14 23:27:22 -07:00
test_integrations_dev_panel.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_integrations.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_internet.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_legacy_subject.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_link_embed.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_logging_handlers.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_management_commands.py email: Migrate to new Python ≥ 3.3 email API. 2020-06-14 20:24:06 -07:00
test_mattermost_importer.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_message_edit_notifications.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_messages.py python: Convert more percent formatting to Python 3.6 f-strings. 2020-06-14 23:27:22 -07:00
test_middleware.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_migrations.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_muting.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_narrow.py python: Manually convert more percent-formatting to f-strings. 2020-06-14 23:27:22 -07:00
test_new_users.py python: Convert more percent formatting to Python 3.6 f-strings. 2020-06-14 23:27:22 -07:00
test_onboarding.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_openapi.py python: Manually convert more percent-formatting to f-strings. 2020-06-14 23:27:22 -07:00
test_outgoing_webhook_interfaces.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_outgoing_webhook_system.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_populate_db.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_presence.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_push_notifications.py push_notifications: Add support for setting counts in iOS. 2020-06-16 11:26:36 -07:00
test_queue_worker.py logging: Use logging.exception and exc_info for unexpected exceptions. 2020-06-14 23:27:22 -07:00
test_queue.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_rate_limiter.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_reactions.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_realm_domains.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_realm_emoji.py python: Convert percent formatting to .format for translated strings. 2020-06-15 16:24:46 -07:00
test_realm_export.py python: Manually convert more percent-formatting to f-strings. 2020-06-14 23:27:22 -07:00
test_realm_filters.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_realm.py realm: Remove Google Hangouts integration. 2020-06-16 17:02:27 -07:00
test_redis_utils.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_report.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_retention.py deletion: Add support for bulk message deletion events. 2020-06-14 22:34:00 -07:00
test_service_bot_system.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_sessions.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_settings.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_signup.py python: Convert more percent formatting to Python 3.6 f-strings. 2020-06-14 23:27:22 -07:00
test_slack_importer.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_slack_message_conversion.py python: Manually convert more percent-formatting to f-strings. 2020-06-14 23:27:22 -07:00
test_soft_deactivation.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_subdomains.py python: Guard against default value mutation with read-only types. 2020-06-13 15:31:27 -07:00
test_submessage.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_subs.py python: Manually convert more percent-formatting to f-strings. 2020-06-14 23:27:22 -07:00
test_templates.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_thumbnail.py python: Manually convert more percent-formatting to f-strings. 2020-06-14 23:27:22 -07:00
test_timestamp.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_tornado.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_transfer.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_tutorial.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_type_debug.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_typing.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_unread.py test_unread: Change flag condition in get_mobile_push_notification_ids. 2020-06-14 20:43:04 -07:00
test_upload.py python: Convert percent formatting to .format for translated strings. 2020-06-15 16:24:46 -07:00
test_urls.py python: Convert more percent formatting to Python 3.6 f-strings. 2020-06-14 23:27:22 -07:00
test_user_groups.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_user_status.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_users.py python: Convert more percent formatting to Python 3.6 f-strings. 2020-06-14 23:27:22 -07:00
test_webhooks_common.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_widgets.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_zcommand.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_zephyr.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00