You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mastodon/spec/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
6 years ago
..
activitypub Use raw status code on have_http_status (#7214) 7 years ago
admin lint pass 2 (#8878) 6 years ago
api rubocop issues - Cleaning up (#8912) 6 years ago
auth Lint pass (#8876) 6 years ago
concerns Improve signature verification safeguards (#8959) 6 years ago
oauth Add force_login option to OAuth authorize page (#8655) 6 years ago
settings lint pass 2 (#8878) 6 years ago
well_known Serialize webfinger XML with Ox instead of Nokogiri (#7319) 7 years ago
about_controller_spec.rb Compensate for scrollbar disappearing when media modal visible (#8100) 7 years ago
account_follow_controller_spec.rb Cover AccountFollowController more in spec (#3227) 8 years ago
account_unfollow_controller_spec.rb Cover AccountUnfollowController more in spec (#3228) 8 years ago
accounts_controller_spec.rb Lint pass (#8876) 6 years ago
application_controller_spec.rb Lint pass (#8876) 6 years ago
authorize_interactions_controller_spec.rb Add remote interaction dialog for toots (#8202) 7 years ago
emojis_controller_spec.rb Misc. typos (#8694) 6 years ago
follower_accounts_controller_spec.rb Add tests for followers_accounts_controller (#7794) 7 years ago
following_accounts_controller_spec.rb Add tests for following accounts controller (#7800) 7 years ago
home_controller_spec.rb Redirect from Web tag timeline to public tag timeline if not signed in (#6633) 7 years ago
intents_controller_spec.rb Add remote interaction dialog for toots (#8202) 7 years ago
invites_controller_spec.rb Lint pass (#8876) 6 years ago
manifests_controller_spec.rb Use raw status code on have_http_status (#7214) 7 years ago
media_controller_spec.rb Use raw status code on have_http_status (#7214) 7 years ago
remote_follow_controller_spec.rb Use raw status code on have_http_status (#7214) 7 years ago
remote_unfollows_controller_spec.rb Lint pass (#8876) 6 years ago
shares_controller_spec.rb Add tests for shares_controller (#7835) 7 years ago
statuses_controller_spec.rb Paginate descendant statuses in public page (#7148) 7 years ago
stream_entries_controller_spec.rb Misc. typos (#8694) 6 years ago
tags_controller_spec.rb Use raw status code on have_http_status (#7214) 7 years ago