Repository navigation
Only verify signatures made out to this site - #3964
Merged
Merged
Conversation
1 of 11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #
Proposed changes:
Host(orX-Original-Host), RFC 9421 fromHostfor@authority,@target-uriand thehostfield. OnlyX-Original-Hostwas checked against this site's hosts so far. Now every one of these values has to name a host this site answers on, otherwise the signature does not verify.X-Original-Hostmoved intois_signature_host(), so both verifiers use the same one. It folds the host the same way as before (IDN, case, port, trailing dot) and uses the sameactivitypub_signature_original_hostsfilter.Other information:
Sites reached under more than one domain, or behind a proxy that rewrites
Hostwithout settingX-Original-Host, have to add the other names with theactivitypub_signature_original_hostsfilter. With Mastodon these requests most likely failed already, because it signs the host.Three existing tests used
example.org/example.netas request host while the test site runs on another host. They only passed because the host was not checked, so they now use the site's own host (or allowexample.orgthrough the filter inTest_Signature).Testing instructions:
vendor/bin/phpunit --filter 'Test_Signature|Test_Functions_Url|Test_Server|Test_Trait_Verification'Changelog entry
Changelog Entry Details
Significance
Type
Message