Skip to content

Commit 30f37f1

Browse files
turt2liverichvdh
authored andcommitted
Sprinkle some DANGER: UNSAFE warnings over the spec about event bodies
Specs [MSC2801](#2801) Based on #3094
1 parent becd225 commit 30f37f1

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

content/_index.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,18 @@ reserved for events defined in the Matrix specification - for instance
232232
`m.room.message` is the event type for instant messages. Events are
233233
usually sent in the context of a "Room".
234234

235+
{{% boxes/warning %}}
236+
Event bodies are considered untrusted data. This means that anyone using
237+
Matrix must validate that the event body is of the expected shape/schema
238+
before using the contents verbatim.
239+
240+
**It is not safe to assume that an event body will have all the expected
241+
fields of the expected types.**
242+
243+
See [MSC2801](https://github.com/matrix-org/matrix-doc/pull/2801) for more
244+
detail on why this assumption is unsafe.
245+
{{% /boxes/warning %}}
246+
235247
### Event Graphs
236248

237249
Events exchanged in the context of a room are stored in a directed

content/client-server-api/_index.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,6 +1381,18 @@ opaque string. No changes should be required to support the currently
13811381
available room versions.
13821382
{{% /boxes/warning %}}
13831383

1384+
{{% boxes/warning %}}
1385+
Event bodies are considered untrusted data. This means that anyone using
1386+
Matrix must validate that the event body is of the expected shape/schema
1387+
before using the contents verbatim.
1388+
1389+
**It is not safe to assume that an event body will have all the expected
1390+
fields of the expected types.**
1391+
1392+
See [MSC2801](https://github.com/matrix-org/matrix-doc/pull/2801) for more
1393+
detail on why this assumption is unsafe.
1394+
{{% /boxes/warning %}}
1395+
13841396
### Types of room events
13851397

13861398
Room events are split into two categories:

0 commit comments

Comments
 (0)