1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-03 12:12:43 +01:00
phorge-phorge/src/applications/phriction
epriestley 54bcbdaba9 Fix an XSS issue with certain high-priority remarkup rules embedded inside lower-priority link rules
Summary:
See <https://hackerone.com/reports/758002>. 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` ]]
```

Differential Revision: https://secure.phabricator.com/D20937
2019-12-13 10:37:50 -08:00
..
application Support (basic) commenting on Phriction documents 2018-09-12 13:20:52 -07:00
codex Remove "stronger/weaker" policy color hints from object headers 2019-11-18 22:05:26 -08:00
conduit Fix handling of Phriction conduit edits 2018-12-10 13:38:13 -08:00
constants Give Phriction documents modern string status constants instead of numeric constants 2018-02-15 18:23:41 -08:00
controller Remove "Moved Document from ..." notice in Phriction 2019-09-12 09:32:26 -07:00
editor Clean up a couple more URI alter() calls 2019-02-15 14:07:17 -08:00
engineextension Add a rough Quick Search datasource for Phriction documents 2018-02-16 09:55:54 -08:00
herald Add a "Published document changed" rule to Herald for Phriction documents 2019-05-16 10:40:52 -07:00
mail phtize all the things 2015-05-22 21:16:39 +10:00
markup Fix an XSS issue with certain high-priority remarkup rules embedded inside lower-priority link rules 2019-12-13 10:37:50 -08:00
phid Give PhrictionContent objects (older versions of wiki pages) legitimate PHIDs 2018-02-15 17:39:07 -08:00
query Reference raw "title" row in Phriction paging, not "c.title" 2019-03-23 07:27:42 -07:00
search Partially clean up Phriction document status constants; introduce "phriction.document.search" 2018-02-15 18:19:10 -08:00
storage When creating a Phriction document, mark initial transactions as "create" transactions to fix weird email 2019-05-22 16:28:25 -07:00
typeahead Make Portals indexable with Ferret 2019-04-10 13:33:54 -07:00
xaction Remove "Moved Document from ..." notice in Phriction 2019-09-12 09:32:26 -07:00