Skip to content

localhost への curl の許可で,-o と -d @file が任意のパスを扱える #289

Closed

Description

@furedea-agent

PR #287 のレビューで見つかった,main に以前からある穴.localhost 向け curl の許可ルールでは,-o の出力先と -d の読み込み元がパスを制限していない.

形 今 後
curl -s -o /Users/kaito/.zshrc http://localhost/ 許可(サーバーの応答で任意のファイルを上書きできる) 確認.許可は作業ツリー内か一時領域への相対・絶対パスに限る
curl -s -d @/etc/passwd http://localhost/ 許可(任意のファイルを localhost に送れる) @ で始まる -d は確認
curl -s -H 'Host: evil.com' http://localhost/ 許可 確認,または許可するヘッダー名を絞る

受け入れ条件

  • 上の 3 つが確認になり,回帰テストがある
  • 開発サーバーの確認でふつうに使う形(-o /dev/null,-d '{...}',-H 'Content-Type: ...')は許可のまま
  • Claude 以外のプロバイダー(サンドボックスで書き込みを制限しないもの)でも同じ判定になる
出典

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions