zulip/frontend_tests/puppeteer_tests
Alex Vandiver db934be064 CVE-2021-41115: Use re2 for user-supplied linkifier patterns.
Zulip attempts to validate that the regular expressions that admins
enter for linkifiers are well-formatted, and only contain a specific
subset of regex grammar.  The process of checking these
properties (via a regex!) can cause denial-of-service via
backtracking.

Furthermore, this validation itself does not prevent the creation of
linkifiers which themselves cause denial-of-service when they are
executed.  As the validator accepts literally anything inside of a
`(?P<word>...)` block, any quadratic backtracking expression can be
hidden therein.

Switch user-provided linkifier patterns to be matched in the Markdown
processor by the `re2` library, which is guaranteed constant-time.
This somewhat limits the possible features of the regular
expression (notably, look-head and -behind, and back-references);
however, these features had never been advertised as working in the
context of linkifiers.

A migration removes any existing linkifiers which would not function
under re2, after printing them for posterity during the upgrade; they
are unlikely to be common, and are impossible to fix automatically.

The denial-of-service in the linkifier validator was discovered by
@erik-krogh and @yoff, as GHSL-2021-118.
2021-10-04 21:26:24 +00:00
..
admin.ts streams: Split setting for stream creation policy. 2021-10-01 10:26:42 -07:00
compose.ts minor: Correct comment in compose test. 2021-05-04 16:40:43 -07:00
copy-and-paste.ts puppeteer_tests: Remove sequential numbers from test files. 2021-04-01 07:46:13 -07:00
custom-profile.ts puppeteer_tests: Remove sequential numbers from test files. 2021-04-01 07:46:13 -07:00
delete-message.ts puppeteer: Remove waitFors on deletion spinners. 2021-10-03 18:47:42 -07:00
drafts.ts puppeteer: remove test_not_delete_draft_on_sending(). 2021-09-10 10:25:48 -07:00
edit.ts puppeteer: Fix the selector for opening the message action menu. 2021-06-12 09:00:57 -04:00
mention.ts custom_check: Avoid use of assert to avoid confusion with assert.equal. 2021-06-10 09:15:57 -07:00
message-basics.ts populate_db: Use do_create_realm for creating zulip realm. 2021-07-06 17:37:43 -07:00
navigation.ts js: Fix @typescript-eslint/restrict-template-expressions. 2021-09-22 18:06:06 -07:00
realm-creation.ts js: Fix @typescript-eslint/restrict-template-expressions. 2021-09-22 18:06:06 -07:00
realm-linkifier.ts CVE-2021-41115: Use re2 for user-supplied linkifier patterns. 2021-10-04 21:26:24 +00:00
realm-playground.ts puppeteer: Fallback to default waitForSelect timeout. 2021-05-24 23:11:41 -07:00
settings.ts puppeteer: Specify container for notification settings tests. 2021-09-16 15:46:41 -07:00
stars.ts puppeteer_tests: Remove sequential numbers from test files. 2021-04-01 07:46:13 -07:00
subscriptions.ts js: Fix @typescript-eslint/no-floating-promises. 2021-09-22 18:06:06 -07:00
user-deactivation.ts confirm_dialog: Rename variables and classes used in templates. 2021-07-14 12:21:24 -07:00
user-status.ts puppeteer: Fix the element becoming stale. 2021-07-30 09:19:56 -07:00