mirror of https://github.com/zulip/zulip.git
tabbed_sections: Fix a backtrack-able regex.
This REDOS was not exploitable, as its content is only read from checked-in files; regardless, simplify it to not backtrack. We also do not actually have any location which use leading or trailing whitespace, so remove those optional bits.
This commit is contained in:
parent
55e4be0939
commit
61262c7b9a
|
@ -9,7 +9,7 @@ from zerver.lib.markdown.priorities import PREPROCESSOR_PRIORITES
|
|||
|
||||
START_TABBED_SECTION_REGEX = re.compile(r"^\{start_tabs\}$")
|
||||
END_TABBED_SECTION_REGEX = re.compile(r"^\{end_tabs\}$")
|
||||
TAB_CONTENT_REGEX = re.compile(r"^\{tab\|\s*(.+?)\s*\}$")
|
||||
TAB_CONTENT_REGEX = re.compile(r"^\{tab\|([^}]+)\}$")
|
||||
|
||||
TABBED_SECTION_TEMPLATE = """
|
||||
<div class="tabbed-section {tab_class}" markdown="1">
|
||||
|
|
Loading…
Reference in New Issue