Homestyx hydra
Diffusion hydra bd4d9d88f2df

Limit remarkup URI protocol length to 32 characters to avoid expensive regex…

Description

Limit remarkup URI protocol length to 32 characters to avoid expensive regex behavior

Summary:
Ref T13608. When searching for bare URIs in remarkup text, don't look for URIs with a protocol string longer than 32 characters.

This avoids a case where the regexp engine may be tricked into executing at O(N^2) or some similar complexity.

Test Plan:

  • Applied remarkup to "AAAA..." (512KB).
  • Before: 64 seconds to process.
  • After: <10ms to process.
  • Ran unit tests.

Maniphest Tasks: T13608

Differential Revision: https://secure.phabricator.com/D21562

Details

Provenance
epriestleyAuthored on Feb 17 2021, 4:08 PM
sirocylPushed on Oct 16 2024, 5:49 AM
Parents
R1:6703fec3e27d: When documents are indexed, record the indexer version (versus the object…
Branches
Unknown
Tags
Unknown

Event Timeline