Misskey直接入力URLのSSRF対策 - #18
Closed
sakots wants to merge 2 commits into
Closed
Conversation
Owner
|
noReitaの基本機能は壊れています。 |
satopian
added a commit
that referenced
this pull request
Aug 18, 2026
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.
noReitaで修正した内容です。
Misskey投稿機能で指定されたサーバーURLが、
FILTER_VALIDATE_URLのみで検証されています。この検証ではlocalhost、プライベートIP、リンクローカルIPなども有効なURLとして扱われるため、Petit Noteの設置サーバーから内部ネットワークへリクエストを送信できる可能性がありました。
MisskeyサーバーURLの検証とcURLの接続設定を強化し、SSRFを防止します。
変更内容
変更したファイル
petitnote/misskey_note.inc.phppetitnote/connect_misskey_api.php新しい設定定数は追加していません。
misskey_note.inc.phpの既存バージョン値のみ更新しています。互換性への影響
Misskeyサーバーの直接入力機能は引き続き利用できますが、次のようなURLは使用できなくなります。
http://のURLこのため、
http://localhost:3000などのローカル開発用Misskeyには接続できません。本番環境でlocalhostへのSSRF経路を作らないことを優先しています。確認内容
misskey.ioのDNS検証git diff --check以上を確認済みです。
(codexを使用してコードの変更を行っています。)