mastodon/spec/controllers
Eugen Rochko 1787704e1c 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:17:36 +02:00
..
activitypub Use raw status code on have_http_status (#7214) 2018-04-21 21:35:07 +02:00
admin Add confirmation step to account suspensions (#8353) 2018-08-22 11:53:41 +02:00
api Make Api::V1::MutesController paginate properly (#8472) 2018-08-26 21:30:17 +02:00
auth Add missing tests for confirmations controller (#7866) 2018-06-21 10:40:23 +09:00
concerns Improve signature verification safeguards (#8959) 2018-10-12 00:17:36 +02:00
oauth Ensure push subscription is immediately removed when application is revoked (#7548) 2018-05-19 21:05:08 +02:00
settings Change language opt-out to language opt-in (#7823) 2018-06-17 13:54:02 +02:00
well_known Serialize webfinger XML with Ox instead of Nokogiri (#7319) 2018-05-02 22:28:46 +02:00
about_controller_spec.rb Compensate for scrollbar disappearing when media modal visible (#8100) 2018-07-31 01:14:33 +02:00
account_follow_controller_spec.rb Cover AccountFollowController more in spec (#3227) 2017-05-22 16:29:48 +02:00
account_unfollow_controller_spec.rb Cover AccountUnfollowController more in spec (#3228) 2017-05-22 17:58:49 +02:00
accounts_controller_spec.rb Use raw status code on have_http_status (#7214) 2018-04-21 21:35:07 +02:00
application_controller_spec.rb Add ability to change an instance default theme from the administration panel (#7092) (#8381) 2018-08-23 14:17:35 +02:00
authorize_interactions_controller_spec.rb Add remote interaction dialog for toots (#8202) 2018-08-18 03:03:12 +02:00
emojis_controller_spec.rb Add a test for emojis_controller (#7652) 2018-05-28 22:56:58 +09:00
follower_accounts_controller_spec.rb Add tests for followers_accounts_controller (#7794) 2018-06-13 10:28:39 +09:00
following_accounts_controller_spec.rb Add tests for following accounts controller (#7800) 2018-06-14 10:49:17 +09:00
home_controller_spec.rb Redirect from Web tag timeline to public tag timeline if not signed in (#6633) 2018-03-05 19:29:36 +01:00
intents_controller_spec.rb Add remote interaction dialog for toots (#8202) 2018-08-18 03:03:12 +02:00
invites_controller_spec.rb Fix tests for invites controller (regression from 4d81809f36) (#7597) 2018-05-23 06:32:10 +02:00
manifests_controller_spec.rb Use raw status code on have_http_status (#7214) 2018-04-21 21:35:07 +02:00
media_controller_spec.rb Use raw status code on have_http_status (#7214) 2018-04-21 21:35:07 +02:00
remote_follow_controller_spec.rb Use raw status code on have_http_status (#7214) 2018-04-21 21:35:07 +02:00
remote_unfollows_controller_spec.rb Add tests for remote_unfollows_controller (#7879) 2018-06-24 19:55:55 +09:00
shares_controller_spec.rb Add tests for shares_controller (#7835) 2018-06-18 10:45:20 +09:00
statuses_controller_spec.rb Paginate descendant statuses in public page (#7148) 2018-04-23 19:27:35 +02:00
stream_entries_controller_spec.rb Use raw status code on have_http_status (#7214) 2018-04-21 21:35:07 +02:00
tags_controller_spec.rb Use raw status code on have_http_status (#7214) 2018-04-21 21:35:07 +02:00