mastodon/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 Add ability to change an instance default theme from the administration panel (#7092) (#8381) 2018-08-23 14:17:35 +02:00
activity_tracker.rb Fix stats expiring too quickly because of variable mistake (#6155) 2018-01-02 14:02:53 +01:00
application_extension.rb
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 Fix missing updated_at attribute on emoji EntityCache (#7297) 2018-04-30 22:49:33 +02:00
exceptions.rb Detect and prevent image bombs, max. processable dimension 4096^2 (#7229) 2018-04-23 09:16:38 +02:00
extractor.rb Using double splat operator (#5859) 2017-12-06 11:41:57 +01:00
fast_geometry_parser.rb Fix avatar and header issues by using custom geometry detector (#6515) 2018-02-21 03:40:12 +01:00
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 Fix activity:interactions counter to count all interactions (#8037) 2018-07-16 18:35:43 +02:00
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 Whitelist dat/ipfs/gopher links in sanitizer (#8034) 2018-07-16 22:17:43 +09:00
sidekiq_error_handler.rb Raise Mastodon::HostValidationError when host for HTTP request is private (#6410) 2018-02-24 19:16:11 +01:00
status_filter.rb Fix n+1 queries in StatusThreadingConcern (#7321) 2018-05-03 10:41:58 +02:00
status_finder.rb Raise an error for remote url in StatusFinder (#4776) 2017-09-02 17:42:47 +02:00
tag_manager.rb Introduce OStatus::TagManager (#5008) 2017-09-19 18:08:08 +02:00
themes.rb Add support for multiple themes (#4959) 2017-09-19 16:36:23 +02:00
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