Page MenuHomePhabricator

Fix an XSS issue with certain high-priority remarkup rules embedded inside lower-priority link rules

Authored by epriestley on Dec 13 2019, 6:35 PM.
Referenced Files
Unknown Object (File)
Tue, Feb 20, 9:57 AM
Unknown Object (File)
Fri, Feb 16, 4:49 AM
Unknown Object (File)
Wed, Feb 14, 5:52 PM
Unknown Object (File)
Wed, Jan 31, 6:55 PM
Unknown Object (File)
Wed, Jan 31, 12:01 AM
Unknown Object (File)
Tue, Jan 30, 11:37 PM
Unknown Object (File)
Jan 21 2024, 7:28 AM
Unknown Object (File)
Dec 11 2023, 6:02 AM



See The link rules don't test that their parameters are flat text before using them in unsafe contexts.

Since almost all rules are lower-priority than these link rules, this behavior isn't obvious. However, two rules have broadly higher priority (monospaced text, and one variation of link rules has higher priority than the other), and the latter can be used to perform an XSS attack with input in the general form ()[ [[ ... | ... ]] ] so that the inner link rule is evaluated first, then the outer link rule uses non-flat text in an unsafe way.

Test Plan

Tested examples in HackerOne report. A simple example of broken (but not unsafe) behavior is:

[[ `x` | `y` ]]

Diff Detail

rP Phabricator
Lint Not Applicable
Tests Not Applicable

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Dec 13 2019, 6:37 PM
epriestley requested review of this revision.
This revision was automatically updated to reflect the committed changes.