Feature API accepts whitespace and control characters as user_id, and has no length limit
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 66/100
調査の方向性
GET /features/{user_id} ハンドラーと、min_length=1 を宣言する POST /features/batch リクエストモデルから始め、次に id を user_key() まで追ってください。issue 内の curl コマンドで whitespace のケースを再現してください。完了とは、whitespace のみの id が両方のルートで同じように扱われ(strip and reject または strip and accept、maintainer の判断による)、255 文字を超える id が上限処理され、#39 のテストがそれに合わせて更新されていることです。
索引モデルが issue の本文から書いたものです。
説明
Follow-up from #39 (the new tests pin current behaviour; this is the part that looks like a bug).
What happens
GET /features/{user_id} declares the parameter as str and passes it straight to user_key() → HGETALL. Nothing trims or validates it, so:
| request | result |
|---|---|
GET /features/%20 |
404, no features for user ' ' — a space is treated as a real key |
GET /features/%09 |
404, tab is a real key |
GET /features/%0A |
404, newline is a real key |
GET /features/<1024 chars> |
404 — no length limit anywhere |
POST /features/batch with "" |
422 (min_length=1) |
POST /features/batch with " " |
200, then a normal miss |
So the two endpoints disagree about what an empty id is, and on the path route a caller can create distinct Redis keys such as eddy:user: and eddy:user:\t simply by requesting them with a write-side call later (or by any producer that copies the id through).
Why it matters
- Two users, or one user and one script, can be split across keys that differ only by invisible characters — silent cache misses and duplicated features.
- No upper bound on the id length means one request can write an arbitrarily long key.
Reproduction
# after the service is up
curl -s -o /dev/null -w '%{http_code}\n' 'http://localhost:8000/features/%20'
curl -s -o /dev/null -w '%{http_code}\n' -X POST 'http://localhost:8000/features/batch' \
-H 'content-type: application/json' -d '{"user_ids": [" "]}'
Expected instead: strip or reject ids that are empty after .strip(), and cap the length (e.g. 255) consistently on both routes.
The tests added in #39 assert today's behaviour deliberately, so they will need updating once this is fixed.
- 主要言語
- Python
- スター
- 2
- フォーク
- 4
- 平均マージ
- 6時間 43分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
midhunsomu/Feature_Store のほかの issue
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
midhunsomu/Feature_Store#14 ·
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
midhunsomu/Feature_Store#12 ·
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
midhunsomu/Feature_Store#11 ·
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
midhunsomu/Feature_Store#10 ·
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
midhunsomu/Feature_Store の issue をすべて見る
似ている issue
-
eegprep-lean: set channel types from the Zarr group's channel_type対応中かも @claude が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
blacklanternsecurity/bbot#3679 ·
メンテナーはふだん 2 日以内に返信
-
Link Checker ReportオープンBot Type: Bug Type: Documentation
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
speakeasy-api/speakeasy#2159 ·
メンテナーはふだん 1 日以内に返信