Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

BUG HTTPTarget stores responses as str(bytes) and the JSON callback can't address keys with digits or hyphens

オープン 初心者向け
#2,813 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
api, backend

調査の方向性

HTTPTarget、HTTPXAPITarget、および _fetch_key のエントリポイントを特定し、それらのレスポンス内容とキーのトークンの扱いを issue の例と比較します。参照として doc/code/targets/10_http_target.ipynb に保存された出力を確認します。レスポンスのテキストがデコード済みのまま保持され、数字またはハイフンを含むキーを分割されずに指定できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Two problems in the HTTP targets.

First, HTTPTarget and HTTPXAPITarget save str(response.content) when there's no callback. content is bytes, so what ends up in memory is the Python repr: b'...' with every non-ASCII character escaped. The regex callback searches that same repr, so matches pick up escapes and a trailing quote:

server text:        'Sure — here’s the answer:\nStep 1: café'
stored:             "b'Sure \\xe2\\x80\\x94 here\\xe2\\x80\\x99s the answer:\\nStep 1: caf\\xc3\\xa9'"
regex 'Step 1: .*': "Step 1: caf\\xc3\\xa9'"

You can see it in the saved output of doc/code/targets/10_http_target.ipynb too (b'<!DOCTYPE html>...).

Second, _fetch_key tokenizes with ([a-zA-Z_]+), so keys with digits or hyphens get split. output2 looks up output, generated-text looks up generated, and both raise.

Fix: use response.text, and treat anything other than ., [ and ] as part of a key.

主要言語
Python
スター
4.5k
フォーク
896
平均マージ
3日 8時間
マージ済み PR(30日)
191

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/PyRIT のほかの issue

microsoft/PyRIT の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。