bastodon/app/controllers
Eugen Rochko 21ad21cb50
Improve signature verification safeguards (#8959)
* Downcase signed_headers string before building the signed string

The HTTP Signatures draft does not mandate the “headers” field to be downcased,
but mandates the header field names to be downcased in the signed string, which
means that prior to this patch, Mastodon could fail to process signatures from
some compliant clients. It also means that it would not actually check the
Digest of non-compliant clients that wouldn't use a lowercased Digest field
name.

Thankfully, I don't know of any such client.

* Revert "Remove dead code (#8919)"

This reverts commit a00ce8c92c.

* Restore time window checking, change it to 12 hours

By checking the Date header, we can prevent replaying old vulnerable
signatures. The focus is to prevent replaying old vulnerable requests
from software that has been fixed in the meantime, so a somewhat long
window should be fine and accounts for timezone misconfiguration.

* Escape users' URLs when formatting them

Fixes possible HTML injection

* Escape all string interpolations in Formatter class

Slightly improve performance by reducing class allocations
from repeated Formatter#encode calls

* Fix code style issues
2018-10-12 00:15:55 +02:00
..
activitypub
admin Replace SVG asset with Custom mascot (#8766) 2018-10-08 00:20:45 +02:00
api Add conversations API (#8832) 2018-10-07 23:44:58 +02:00
auth Misc. typos (#8694) 2018-09-14 00:53:09 +02:00
concerns Improve signature verification safeguards (#8959) 2018-10-12 00:15:55 +02:00
oauth Add force_login option to OAuth authorize page (#8655) 2018-09-09 04:10:44 +02:00
settings Add a new preference to always hide all media (#8569) 2018-09-25 05:09:35 +02:00
well_known
about_controller.rb Update /terms and /about/more to use public layout (#8142) 2018-08-09 12:58:20 +02:00
account_follow_controller.rb
account_unfollow_controller.rb
accounts_controller.rb Unuse ActiveRecord::Base#cache_key (#8185) 2018-08-19 15:52:38 +02:00
application_controller.rb Add force_login option to OAuth authorize page (#8655) 2018-09-09 04:10:44 +02:00
authorize_interactions_controller.rb Add remote interaction dialog for toots (#8202) 2018-08-18 03:03:12 +02:00
custom_css_controller.rb Add admin custom CSS setting (#8399) 2018-08-24 04:33:27 +02:00
emojis_controller.rb Unuse ActiveRecord::Base#cache_key (#8185) 2018-08-19 15:52:38 +02:00
filters_controller.rb Fix whole-word selection and i18n: Add Japanese translation for Whole-word (#8004) 2018-07-12 17:58:26 +02:00
follower_accounts_controller.rb
following_accounts_controller.rb
home_controller.rb Ensure single user is a local user (fixes #8154) (#8157) 2018-08-11 11:53:10 +02:00
intents_controller.rb Add remote interaction dialog for toots (#8202) 2018-08-18 03:03:12 +02:00
invites_controller.rb Order invites by recent first (#8091) 2018-07-28 17:15:17 -04:00
manifests_controller.rb
media_controller.rb
media_proxy_controller.rb
remote_follow_controller.rb Add remote interaction dialog for toots (#8202) 2018-08-18 03:03:12 +02:00
remote_interaction_controller.rb Add remote interaction dialog for toots (#8202) 2018-08-18 03:03:12 +02:00
remote_unfollows_controller.rb
shares_controller.rb
statuses_controller.rb Set Content-Security-Policy rules through RoR's config (#8957) 2018-10-11 20:35:46 +02:00
stream_entries_controller.rb
tags_controller.rb Compensate for scrollbar disappearing when media modal visible (#8100) 2018-07-31 01:14:33 +02:00