mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-14 22:30:44 +00:00
0c2b33458d
In Mastodon media can only be used by owners and only be associated with
a single post. We currently allow media to be associated with several
posts and until now did not limit their usage in posts to media owners.
However, media update and GET lookup was already limited to owners.
(In accordance with allowing media reuse, we also still allow GET
lookups of media already used in a post unlike Mastodon)
Allowing reuse isn’t problematic per se, but allowing use by non-owners
can be problematic if media ids of private-scoped posts can be guessed
since creating a new post with this media id will reveal the uploaded
file content and alt text.
Given media ids are currently just part of a sequentieal series shared
with some other objects, guessing media ids is with some persistence
indeed feasible.
E.g. sampline some public media ids from a real-world
instance with 112 total and 61 monthly-active users:
17.465.096 at t0
17.472.673 at t1 = t0 + 4h
17.473.248 at t2 = t1 + 20min
This gives about 30 new ids per minute of which most won't be
local media but remote and local posts, poll answers etc.
Assuming the default ratelimit of 15 post actions per 10s, scraping all
media for the 4h interval takes about 84 minutes and scraping the 20min
range mere 6.3 minutes. (Until the preceding commit, post updates were
not rate limited at all, allowing even faster scraping.)
If an attacker can infer (e.g. via reply to a follower-only post not
accessbile to the attacker) some sensitive information was uploaded
during a specific time interval and has some pointers regarding the
nature of the information, identifying the specific upload out of all
scraped media for this timerange is not impossible.
Thus restrict media usage to owners.
Checking ownership just in ActivitDraft would already be sufficient,
since when a scheduled status actually gets posted it goes through
ActivityDraft again, but would erroneously return a success status
when scheduling an illegal post.
Independently discovered and fixed by mint in Pleroma
|
||
---|---|---|
.. | ||
account_controller_test.exs | ||
announcement_controller_test.exs | ||
app_controller_test.exs | ||
auth_controller_test.exs | ||
conversation_controller_test.exs | ||
custom_emoji_controller_test.exs | ||
directory_controller_test.exs | ||
domain_block_controller_test.exs | ||
filter_controller_test.exs | ||
follow_request_controller_test.exs | ||
instance_controller_test.exs | ||
list_controller_test.exs | ||
marker_controller_test.exs | ||
media_controller_test.exs | ||
notification_controller_test.exs | ||
poll_controller_test.exs | ||
report_controller_test.exs | ||
scheduled_activity_controller_test.exs | ||
search_controller_test.exs | ||
status_controller_test.exs | ||
subscription_controller_test.exs | ||
suggestion_controller_test.exs | ||
tag_controller_test.exs | ||
timeline_controller_test.exs |