http.cookies: parser accepts key characters that Morsel.set then rejects
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
Bug report
Bug description:
SimpleCookie.load() extracts cookie names using _LegalKeyChars, which deliberately admits characters RFC 6265 forbids in a token — the comment above it cites MSIE non-compliance as the reason. Morsel.set() then validates with _is_legal_key, built from _LegalChars, which excludes them. Twelve separator characters differ, so any Set-Cookie whose name contains one raises CookieError even though the module's own parser accepted it.
Encountered in the wild: F5 BIG-IP load balancers emit a persistence cookie named for the partition path, /Common/.app/--pool. Browsers accept this...
from http.cookies import SimpleCookie
SimpleCookie('/a/b=1') # also a@b=1, a,b=1, a(b)=1
CPython versions tested on:
3.14
Operating systems tested on:
Linux
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
この issue では SimpleCookie.load()、Morsel.set()、_LegalKeyChars、_is_legal_key、_LegalChars が挙げられています。まず、これらの parser および validation の経路を追跡し、一覧にある cookie 名を再現してください。受け入れられる名前の動作に一貫性があり、例で CookieError が発生しなくなり、その不一致に対する regression coverage があれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- networking
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 活発
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 68/100