akkoma/test/fixtures
Oneric 8684964c5d Only allow exact id matches
This protects us from falling for obvious spoofs as from the current
upload exploit (unfortunately we can’t reasonably do anything about
spoofs with exact matches as was possible via emoji and proxy).

Such objects being invalid is supported by the spec, sepcifically
sections 3.1 and 3.2: https://www.w3.org/TR/activitypub/#obj-id

Anonymous objects are not relevant here (they can only exists within
parent objects iiuc) and neither is client-to-server or transient objects
(as those cannot be fetched in the first place).
This leaves us with the requirement for `id` to (a) exist and
(b) be a publicly dereferencable URI from the originating server.
This alone does not yet demand strict equivalence, but the spec then
further explains objects ought to be fetchable _via their ID_.
Meaning an object not retrievable via its ID, is invalid.

This reading is supported by the fact, e.g. GoToSocial (recently) and
Mastodon (for 6+ years) do already implement such strict ID checks,
additionally proving this doesn’t cause federation issues in practice.

However, apart from canonical IDs there can also be additional display
URLs. *omas first redirect those to their canonical location, but *keys
and Mastodon directly serve the AP representation without redirects.

Mastodon and GTS deal with this in two different ways,
but both constitute an effective countermeasure:
 - Mastodon:
   Unless it already is a known AP id, two fetches occur.
   The first fetch just reads the `id` property and then refetches from
   the id. The last fetch requires the returned id to exactly match the
   URL the content was fetched from. (This can be optimised by skipping
   the second fetch if it already matches)
   05eda8d193/app/helpers/jsonld_helper.rb (L168)
   63f0979799

 - GTS:
   Only does a single fetch and then checks if _either_ the id
   _or_ url property (which can be an object) match the original fetch
   URL. This relies on implementations always including their display URL
   as "url" if differing from the id. For actors this is true for all
   investigated implementations, for posts only Mastodon includes an
   "url", but it is also the only one with a differing display URL.
   2bafd7daf5 (diff-943bbb02c8ac74ac5dc5d20807e561dcdfaebdc3b62b10730f643a20ac23c24fR222)

Albeit Mastodon’s refetch offers higher compatibility with theoretical
implmentations using either multiple different display URL or not
denoting any of them as "url" at all, for now we chose to adopt a
GTS-like refetch-free approach to avoid additional implementation
concerns wrt to whether redirects should be allowed when fetching a
canonical AP id and potential for accidentally loosening some checks
(e.g. cross-domain refetches) for one of the fetches.
This may be reconsidered in the future.
2024-03-25 14:05:05 -01:00
..
bridgy
collections
config
emoji/packs
fedibird
fetch_mocks
friendica
mastodon
microblogpub
misskey
modules
peertube
preload_static/instance
quote_post
relay
rich_media
rsa_keys
runtime_modules
statuses
tesla_mock
users_mock
warnings/otp_version
webfinger
activitypub-client-post-activity.json
avatar_data_uri
bogus-mastodon-announce.json
bookwyrm-article.json
bookwyrm-replies-collection.json
create-chat-message.json
create-pleroma-reply-to-misskey-thread.json
custom-emoji-reaction.json
custom_instance_panel.html AdminAPI: Allow to modify Terms of Service and Instance Panel via Admin API 2020-09-17 16:48:07 +03:00
DSCN0010.jpg
emoji-reaction-no-emoji.json
emoji-reaction-too-long.json
emoji-reaction.json
emojis.zip
empty.zip
friendica_salmon.xml
guppe-actor.json
host-meta-zetsubou.xn--q9jyb4c.xml
hubzilla-follow-activity.json
image.gif
image.jpg
image.png
kroeg-announce-with-inline-actor.json
kroeg-array-less-emoji.json
kroeg-array-less-hashtag.json
kroeg-post-activity.json
lain.xml
lambadalambda.json
margaret-corbin-grave-west-point.html
mastodon-accept-activity.json
mastodon-announce-private.json
mastodon-announce.json
mastodon-block-activity.json
mastodon-create-with-attachment.json
mastodon-delete-user.json
mastodon-delete.json
mastodon-follow-activity.json
mastodon-like.json
mastodon-note-object.json
mastodon-post-activity-contentmap.json
mastodon-post-activity-hashtag.json
mastodon-post-activity-nsfw.json
mastodon-post-activity.json
mastodon-question-activity.json
mastodon-reject-activity.json
mastodon-unblock-activity.json
mastodon-undo-announce.json
mastodon-undo-like-compact-object.json
mastodon-undo-like.json
mastodon-unfollow-activity.json
mastodon-update.json
mastodon-vote.json
mewmew_no_name.json
misskey-like.json
nypd-facial-recognition-children-teenagers.html
nypd-facial-recognition-children-teenagers2.html
nypd-facial-recognition-children-teenagers3.html
nypd-facial-recognition-children-teenagers4.html
osada-follow-activity.json
owncast-note-with-attachment.json
prismo-url-map.json
private_key.pem
quoted_status.json
rel_me_anchor.html
rel_me_anchor_nofollow.html
rel_me_link.html
rel_me_null.html
salmon.xml
salmon2.xml
sound.mp3
spoofed-object.json
test.txt
user_full.xml
user_name_only.xml
video.mp4
webfinger.xml
xml_billion_laughs.xml
xml_external_entities.xml
xml_normal.xml