sts: accept WebIdentityToken from POST body, not only the query string

オープン
#70 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
65/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
rust

調査の方向性

まず crates/sts/src/route_handler.rs の try_handle_sts と crates/sts/src/request.rs の try_parse_sts_request を読み、query がどのように parsing に渡されるかを追跡します。STS route の request-body の処理を確認したうえで、互換性のために query parsing を維持しつつ、body を優先して application/x-www-form-urlencoded の POST パラメータが機能するようにします。

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

説明

Summary

multistore-sts parses the AssumeRoleWithWebIdentity WebIdentityToken exclusively from the query string. The StsRouterExt handler calls try_handle_sts(req.query, …) (crates/sts/src/route_handler.rs), and try_parse_sts_request is documented as "Extracts AssumeRoleWithWebIdentity parameters from query strings" (crates/sts/src/request.rs). There is no path to supply the token in the request body.

This mirrors the AWS STS Query API convention, but it means the bearer-grade OIDC token always travels in the URL.

Why it matters

URLs leak into far more places than headers or bodies: CDN/edge access logs, reverse-proxy logs, browser history, and the Referer header. A WebIdentityToken captured from any of these within its validity window can be replayed to mint the user's temporary credentials.

A downstream consumer (the Source Cooperative data proxy, which mounts with_sts("/.sts", …)) carefully avoids logging query strings on the STS route, but it cannot prevent intermediaries from capturing the full URL, because the crate offers no body-based alternative.

Request

Allow the WebIdentityToken (and the other AssumeRoleWithWebIdentity params) to be read from an application/x-www-form-urlencoded POST body, matching how the real AWS STS endpoint accepts form-POST requests. Query-string parsing can remain for backwards compatibility, with the body taking precedence when present.

Concretely, try_handle_sts / try_parse_sts_request would need to also accept the request body, and RouteHandler for the STS route would parse POST bodies in addition to the query.

References

  • crates/sts/src/route_handler.rs — try_handle_sts(req.query, …)
  • crates/sts/src/request.rs — try_parse_sts_request(query: Option<&str>)

Filed from a security review of a downstream integration (Source Cooperative data proxy). Happy to help with a PR if the approach sounds right.

主要言語
Rust
スター
20
フォーク
1
平均マージ
8時間 29分
マージ済み PR(30日)
2

環境構築

はじめの一歩

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

developmentseed/multistore のほかの issue

developmentseed/multistore の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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