chinwagsocial/app/lib
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 Fix typo in ActivityPub Create handler (#8952) 2018-10-11 02:10:15 +02:00
ostatus Improve federated ID validation (#8372) 2018-08-22 20:55:14 +02:00
settings
activity_tracker.rb
application_extension.rb Conditional validations no longer accept strings for if/unless (#3124) 2017-05-19 03:11:23 +02:00
delivery_failure_tracker.rb After 7 days of repeated delivery failures, give up on inbox (#5131) 2017-09-29 03:16:20 +02:00
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 00:15:55 +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 Add RSS feeds for end-users (#7259) 2018-04-25 02:10:02 +02:00
sanitize_config.rb
sidekiq_error_handler.rb
status_filter.rb
status_finder.rb
tag_manager.rb
themes.rb
user_settings_decorator.rb Add a new preference to always hide all media (#8569) 2018-09-25 05:09:35 +02:00
webfinger_resource.rb