Oneric
8684964c5d
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) |
||
---|---|---|
.. | ||
activity | ||
akkoma | ||
captcha | ||
collections | ||
config | ||
conversation | ||
docs | ||
ecto_type | ||
emails | ||
emoji | ||
helpers | ||
http | ||
instances | ||
mfa | ||
migration_helper | ||
migrators | ||
object | ||
password | ||
reverse_proxy | ||
search | ||
tests | ||
upload | ||
uploaders | ||
user | ||
web | ||
workers | ||
activity.ex | ||
announcement.ex | ||
announcement_read_relationship.ex | ||
application.ex | ||
application_requirements.ex | ||
bookmark.ex | ||
caching.ex | ||
captcha.ex | ||
clippy.ex | ||
config.ex | ||
config_db.ex | ||
constants.ex | ||
conversation.ex | ||
counter_cache.ex | ||
data_migration.ex | ||
delivery.ex | ||
ecto_enums.ex | ||
emoji-test.txt | ||
emoji.ex | ||
filter.ex | ||
following_relationship.ex | ||
formatter.ex | ||
frontend.ex | ||
hashtag.ex | ||
healthcheck.ex | ||
html.ex | ||
http.ex | ||
instances.ex | ||
iso639.ex | ||
job_queue_monitor.ex | ||
jwt.ex | ||
keys.ex | ||
list.ex | ||
logging.ex | ||
maintenance.ex | ||
maps.ex | ||
marker.ex | ||
mfa.ex | ||
moderation_log.ex | ||
notification.ex | ||
object.ex | ||
object_tombstone.ex | ||
otp_version.ex | ||
pagination.ex | ||
password.ex | ||
password_reset_token.ex | ||
prometheus_exporter.ex | ||
registration.ex | ||
release_tasks.ex | ||
repo.ex | ||
report_note.ex | ||
reverse_proxy.ex | ||
scheduled_activity.ex | ||
search.ex | ||
signature.ex | ||
stats.ex | ||
thread_mute.ex | ||
upload.ex | ||
user.ex | ||
user_invite_token.ex | ||
user_note.ex | ||
user_relationship.ex | ||
utils.ex | ||
web.ex | ||
xml_builder.ex |