mastodon/app/lib
Eugen Rochko fac529975b 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 07:00:41 +02:00
..
activitypub Fix handling of ActivityPub activities lacking some attributes (#8864) 2018-10-03 23:44:13 +02:00
ostatus Improve federated ID validation (#8372) 2018-08-22 20:55:14 +02:00
settings Merge branch 'master' into glitch-soc/merge-upstream 2018-08-24 15:10:34 +02:00
activity_tracker.rb
application_extension.rb
delivery_failure_tracker.rb
entity_cache.rb
exceptions.rb
extractor.rb
fast_geometry_parser.rb
feed_manager.rb Exclude replies from list timelines (#8683) 2018-09-28 00:37:21 +02:00
formatter.rb Improve signature verification safeguards (#8959) 2018-10-12 07:00:41 +02:00
hash_object.rb
inline_renderer.rb Add conversations API (#8832) 2018-10-07 23:44:58 +02:00
language_detector.rb Leave unknown language as nil if account is remote (#8861) 2018-10-05 19:17:46 +02:00
potential_friendship_tracker.rb
request.rb Do not sign useless User-Agent or Accept-Encoding headers (#8533) 2018-08-31 04:22:52 +02:00
rss_builder.rb
sanitize_config.rb
sidekiq_error_handler.rb
status_filter.rb
status_finder.rb
tag_manager.rb
themes.rb
user_settings_decorator.rb Merge branch 'master' into glitch-soc/merge-upstream 2018-10-01 12:43:20 +02:00
webfinger_resource.rb