0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-05 21:57:36 +08:00
discourse/app/jobs
Alan Guo Xiang Tan fa74e0dec7 SECURITY: Authorize secure-upload hotlink downloads against post user
Advisory: https://github.com/discourse/discourse/security/advisories/GHSA-3876-w96v-8v38

When a post embeds an `<img>` pointing at a secure-uploads URL whose upload is owned by an access-controlled post (for example a private category), `Jobs::PullHotlinkedImages` would resolve the presigned S3 URL and attach a fresh local copy of the upload to the embedding post regardless of whether its author could see the original. A user could hotlink the secure-uploads URL of media they should not have access to into a post they authored, and `Jobs::PullHotlinkedImages` would create a fresh local copy attached to their post.

This commit gates `Jobs::PullHotlinkedImages#should_download_image?` on a new `can_see_upload?` helper. For secure uploads the helper checks the post author against the upload's `access_control_post` with `user.guardian.can_see_post?`. When the author cannot see the access-control post, the job leaves the original secure URL in place and does not create a local copy.
2026-06-30 16:10:52 +02:00
..
concerns DEV: Enable Style/RedundantParentheses rubocop rule (#40095) 2026-05-19 15:48:09 +02:00
onceoff DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00
regular SECURITY: Authorize secure-upload hotlink downloads against post user 2026-06-30 16:10:52 +02:00
scheduled FEATURE: Improve display of installed/available version on dashboard (#41165) 2026-06-24 13:07:05 +01:00
base.rb DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00