RFC 7541 Quiz

HPACK (HTTP/2 Header Compression)

0 / 0

References (URLs)

狙い: static table / dynamic table、indexing、セキュリティ上の注意点を押さえる。

Q1: HPACKの主目的として最も近いのはどれ

Multiple Choice
HPACK は, よく出る header を table に置き, 毎回文字列を丸ごと送らず index や短い表現で参照する仕組みです. RFC を読むときも, 「生の header を送る」のではなく「table を共有しながら参照する」と捉えると分かりやすくなります.
HTTP header :method, cookie, ... encoder static table dynamic table index / literal を選ぶ 小さい表現で送る decoder 同じ table で復元
**Explanation:** **Terms:** header compression, static table, dynamic table, indexing. HPACK は, 頻出する header field を table に寄せ, その table を index で参照して wire 上の bytes を減らす仕組みです. **RFCを読むときの見方:** RFC 7541 は, 文字列圧縮の文書というより, encoder と decoder が同じ table 状態を共有しながら header block をやり取りする文書だと考えると読みやすくなります. 「今この header は文字列そのものを送るのか, 既存 index を参照するのか」を追うのがコツです. **Correct (B):** 既知の header field を table 参照や短い literal で表し, wire 上のサイズを減らすのが主目的です. だから HPACK は帯域効率と遅延の改善に効きます. **Options:** - A (incorrect): header の **暗号化** は TLS の役割です. HPACK は圧縮であって, 秘密を守る仕組みではありません. - B (correct): これが HPACK の中心です. - C (incorrect): server authenticity は TLS や certificate validation の仕事で, HPACK は保証しません. **Related:** HTTP/3 では ordered delivery 前提が変わるため, HPACK ではなく **QPACK** が使われます.

Q2: connection内で共有され, 時間と共に変化するtableはどれ

Multiple Choice
**Explanation:** **Terms:** dynamic table, connection state **Correct (C):** requestやresponseのheader blockにより追加やevictが発生する **Options:** - A (incorrect): static tableは仕様で固定 - B (incorrect): HPACKとは無関係 - C (correct): dynamic tableはconnectionごとの状態 **Related:** stateずれはdecompression failureやprotocol errorの原因になる

Q3: 一般にsensitive扱いで, indexingを避けたいheaderはどれ (複数選択)

Multi-Select
**Explanation:** **Terms:** sensitive header field, never indexed, side channel **Correct (A,C,D):** credentialやsession identifierは高価値で, 圧縮のside channelも意識したい **Options:** - A (correct): secretを含み得る - B (incorrect): 低感度なことが多い - C (correct): session identifierを含み得る - D (correct): session identifierを設定することが多い **Related:** attacker controlled inputとsecretが同一圧縮文脈にあると情報が漏れることがある

Q4: peerのHPACK dynamic tableの最大サイズを制約するものはどれ

Multiple Choice
**Explanation:** **Terms:** SETTINGS, dynamic table size **Correct (A):** limitを交渉し, encoderはそれを守る必要がある **Options:** - A (correct): memoryの暴走を防ぐ - B (incorrect): 無関係 - C (incorrect): 無関係 **Related:** encoderはdynamic table size updateも送れる

Q5: HPACKが文字列の符号化で使えるprefix free codingは何 (1語)

Short Text
**Explanation:** **Terms:** Huffman coding **Correct:** Huffman **Related:** HPACKは専用のHuffman tableを定義している

Q6: secretとattackerが影響できるdataを同じ圧縮文脈で扱うと起き得る典型リスクはどれ

Multiple Choice
**Explanation:** **Terms:** compression side channel, attacker chosen input **Correct (C):** サイズ差などがsecret推測に使われることがある **Options:** - A (incorrect): 無関係 - B (incorrect): TLSの話 - C (correct): 圧縮の副作用として知られる **Related:** cookieやcredentialをsensitive扱いにして, indexing方針を設計する