mei23 / misskey

めいすきー
GNU Affero General Public License v3.0
68 stars 12 forks source link

HTTP Signature検証のリファクタ #4750

Closed mei23 closed 9 months ago

mei23 commented 9 months ago

Summary

https://github.com/mei23/misskey/pull/4749 を少しシンプルにする、効力は変わらない。

署名必須ヘッダーの検証はライブラリの機能にあるのでそれを使用するようにする。 もちろん、DigestヘッダーがBodyのそれと一致するかみたいな照合は別途必要なのでそのまま。

bodyParser使用はわかりずらいのでそのまま。

仕様の変更

署名対象ヘッダーに (request-target), date が含まれない実装からのActivityも弾かれるようになる可能性があるが、実影響はないと思われる。

dateが300秒以上ずれている場合 (主にどちらかの時計が狂っている場合) 弾かれるようになります。

https://git.joinfirefish.org/firefish/firefish/-/commit/3272b908c63b24f056d01c180e546f124009a6d1

Co-authored-by: Laura Hausmann <laura@hausmann.dev>
mei23 commented 9 months ago

https://github.com/mei23/misskey/commit/f7c82eb3b9c947e681817f3ec92498c65b5bd864 も入れたほうがシンプル&微修正

mei23 commented 9 months ago

https://github.com/mei23/misskey/commit/68a62388e484759b465a4aeeec804925d59c30bf https://github.com/mei23/misskey/commit/91f5007a4787970e7df914e7aa987b64a0c074ab https://github.com/mei23/misskey/commit/65add66b824475ccd656720bc1e3927b394e7a97

mei23 commented 9 months ago

リクエストホストも検証 https://github.com/mei23/misskey/commit/1be3c99ea721de4d6e095327a0fb085f0acf49e5