summaryrefslogtreecommitdiff
path: root/test/fixtures
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2020-10-28 18:08:23 +0300
committerrinpatch <rinpatch@sdf.org>2020-11-12 15:25:33 +0300
commit6ca709816f74f1171423c7bc040619fca57a2087 (patch)
treec63d54e69018c195279ff946f8f3990b25215cef /test/fixtures
parent99bc175f0257fb0cb9275cba94df662ed219eacf (diff)
downloadpleroma-6ca709816f74f1171423c7bc040619fca57a2087.tar.gz
pleroma-6ca709816f74f1171423c7bc040619fca57a2087.zip
Fix object spoofing vulnerability in attachments
Validate the content-type of the response when fetching an object, according to https://www.w3.org/TR/activitypub/#x3-2-retrieving-objects. content-type headers had to be added to many mocks in order to support this, some of this was done with a regex. While I did go over the resulting files to check I didn't modify anything unrelated, there is a possibility I missed something. Closes pleroma#1948
Diffstat (limited to 'test/fixtures')
-rw-r--r--test/fixtures/spoofed-object.json26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/fixtures/spoofed-object.json b/test/fixtures/spoofed-object.json
new file mode 100644
index 000000000..91e34307d
--- /dev/null
+++ b/test/fixtures/spoofed-object.json
@@ -0,0 +1,26 @@
+{
+ "@context": [
+ "https://www.w3.org/ns/activitystreams",
+ "https://patch.cx/schemas/litepub-0.1.jsonld",
+ {
+ "@language": "und"
+ }
+ ],
+ "actor": "https://patch.cx/users/rin",
+ "attachment": [],
+ "attributedTo": "https://patch.cx/users/rin",
+ "cc": [
+ "https://patch.cx/users/rin/followers"
+ ],
+ "content": "Oracle Corporation (NYSE: ORCL) today announced that it has signed a definitive merger agreement to acquire Pleroma AG (FRA: PLA), for $26.50 per share (approximately $10.3 billion). The transaction has been approved by the boards of directors of both companies and should close by early January.",
+ "context": "https://patch.cx/contexts/spoof",
+ "id": "https://patch.cx/objects/spoof",
+ "published": "2020-10-23T18:02:06.038856Z",
+ "sensitive": false,
+ "summary": "Oracle buys Pleroma",
+ "tag": [],
+ "to": [
+ "https://www.w3.org/ns/activitystreams#Public"
+ ],
+ "type": "Note"
+}