Node SDK: send accepts malformed user headers that fail during polling

オープン
#4,750 コメント 3 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Subham-KRLX がすでに取り組んでいます。

2026年11月4日 から。

  • #4764 @Subham-KRLX による — オープン

評価

この issue はまだ評価されていません。

説明

bug good first issue javascript
Bug description

The Node SDK accepts malformed user headers when sending messages, but polling those messages fails to decode them.

Confirmed cases:

  • Empty raw header value.
  • String value longer than 255 bytes.
  • Int128 value containing only one byte instead of 16.
  • Empty string key.

Each send receives a confirmation at offset 0. Polling then fails with “user headers of the message at offset 0 do not decode.” A valid string header sends and polls successfully.

The encoder should reject these invalid headers before sending. Confirmed against a real server using SDK and server revision 7b053f4cbf635d03ba187123a42c0157ac554587.

Related fixes #4481 (Go) and #4670 (HTTP) do not cover the Node encoder. I would like to contribute a regression test first and discuss the fix approach.

Affected area / component

Node.js SDK

Deployment

Docker (DockerHub image)

Versions

SDK and server revision: 7b053f4cbf635d03ba187123a42c0157ac554587

Server image: apache/iggy:edge

Image digest: sha256:3dba2cd7b16e0362112ae248507b4a7b2eb27593332c6421386011fb1795975d

Hardware / environment

macOS, Node.js v24.4.1, fresh single-node Iggy server in Docker. Tested using the upstream Node SDK over TCP, with isolated container storage.

Sample code
const headers = [{
  key: HeaderKeyFactory.String('key'),
  value: HeaderValue.Raw(Buffer.alloc(0))
}];

const result = await client.message.send({
  streamId,
  topicId,
  partition: Partitioning.PartitionId(0),
  messages: [{ id: 1n, payload: 'repro', headers }]
});
// Send succeeds with a confirmation at offset 0.

await client.message.poll({
  streamId,
  topicId,
  consumer: Consumer.Single,
  partitionId: 0,
  pollingStrategy: PollingStrategy.First,
  count: 1,
  autocommit: false
});
// Fails to decode the stored message's headers.
Logs

valid: SEND CONFIRMED offset=0
valid: POLL SUCCEEDED
empty-value: SEND CONFIRMED offset=0
empty-value: POLL FAILED user headers of the message at offset 0 do not decode; cause=Invalid header value length: 0, must be between 1 and 255

Iggy server config

Fresh single-node server with development credentials.

IGGY_HTTP_ADDRESS=0.0.0.0:3000
IGGY_TCP_ADDRESS=0.0.0.0:38090
IGGY_NODE_ADVERTISED_ADDRESS=localhost

TCP port 38090 was published to localhost. No custom persistence settings.

Reproduction
  1. Start a fresh Iggy server and connect using the Node SDK.
  2. Create a stream and a topic with one partition.
  3. Send a message containing a string header key and an empty raw header value, as shown above.
  4. The send succeeds and confirms offset 0.
  5. Poll the topic from the first offset.
  6. Polling fails because the header value length is 0.

Also reproduced with:

  • HeaderValue.String('a'.repeat(256))
  • HeaderValue.Int128(Buffer.from([1]))
  • HeaderKeyFactory.String('') with a nonempty value

A normal nonempty string key and value send and poll successfully.

Contribution
  • I'm willing to submit a pull request to fix this bug
Good first issue
  • I think this could be a good first issue for a new contributor
主要言語
Rust
スター
5.2k
フォーク
502
平均マージ
3日 3時間
マージ済み PR(30日)
163

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

apache/iggy のほかの issue

apache/iggy の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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