in_syslog: PRI values above 191 are accepted and the tag gets an empty facility
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
lib/fluent/plugin/in_syslog.rb の issue で参照されている PRI からタグへのマッピングから始め、デフォルト設定の場合と with_priority false の場合の両方で PRI がどのように解析されるかを追ってください。無効な syslog メッセージに関する既存のテストを確認し、両方のモードで 191 を超える PRI 値のテストを追加してください。無効な PRI 値について警告が出て出力されず、有効な PRI 191 は引き続き機能することを完了条件とします。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
in_syslog builds the tag from FACILITY_MAP[pri >> 3] and SEVERITY_MAP[pri & 0b111]. It does not check that PRI is in the valid range 0 to 191. For a larger PRI, the facility is nil, and the tag gets an empty part.
https://github.com/fluent/fluentd/blob/e7d3c3e4/lib/fluent/plugin/in_syslog.rb#L325
- With the default parse settings (
with_priority true),<200>is emitted with the tagsyslog..emerg. (<1234>is rejected, because the parser reads at most 3 digits.) - With
with_priority false, in_syslog reads PRI withSYSLOG_REGEXP([0-9]+).<200>givessyslog..emerg, and<1234>givessyslog..crit.
To Reproduce
Run Fluentd with the configuration below. Then send these messages:
ruby -rsocket -e 'u = UDPSocket.new; ["<200>Apr 25 16:43:29 host app: msg", "<1234>Apr 25 16:43:29 host app: msg", "<191>Apr 25 16:43:29 host app: msg"].each { |m| u.send(m, 0, "127.0.0.1", 5140) }'
Output on master (e7d3c3e4) with the default parse settings:
2026-04-25 16:43:29.000000000 +0900 syslog..emerg: {"host":"host","ident":"app","message":"msg"}
[warn]: failed to parse message data="<1234>Apr 25 16:43:29 host app: msg"
2026-04-25 16:43:29.000000000 +0900 syslog.local7.debug: {"host":"host","ident":"app","message":"msg"}
Output with with_priority false in <parse>:
2026-04-25 16:43:29.000000000 +0900 syslog..emerg: {"host":"host","ident":"app","message":"msg"}
2026-04-25 16:43:29.000000000 +0900 syslog..crit: {"host":"host","ident":"app","message":"msg"}
2026-04-25 16:43:29.000000000 +0900 syslog.local7.debug: {"host":"host","ident":"app","message":"msg"}
Expected behavior
A PRI outside 0 to 191 is treated as invalid, as RFC 5424 defines this range. in_syslog warns and does not emit it with a broken tag, like other invalid messages.
Your Environment
- Fluentd version: master (e7d3c3e4). v1.20.1 and v1.19.4 have the same code (not run).
- Package version: -
- Operating system: Linux
- Kernel version: -
Your Configuration
<source>
@type syslog
port 5140
bind 127.0.0.1
tag syslog
# For the second case:
# <parse>
# @type syslog
# with_priority false
# </parse>
</source>
<match syslog.**>
@type stdout
</match>
Your Error Log
No error is logged for <200>.
- 主要言語
- Ruby
- スター
- 13.6k
- フォーク
- 1.4k
- 平均マージ
- 17時間 28分
- マージ済み PR(30日)
- 66
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fluent/fluentd のほかの issue
-
parser_syslog: message_format auto parses RFC 3164 messages with an RFC 3339 timestamp as RFC 5424オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
out_forward: unacknowledged chunks are resent forever with heartbeat_type none, ignoring retry limits and secondary対応中かも @SahinurDEV が 1 日前に担当しました。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 74/100
fluent/fluentd#5619 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
A label looked up at runtime during a graceful reload can keep dropping the events of a tag対応中かも @sarankumar1325 が今日担当しました。 オープンbug
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
Websockify heartbeat for vnc_container対応中かも @robinkar が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
needs verification
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 7 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
akitaonrails/ai-book-2026#13 ·
-
Mend: dependency security vulnerability
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
メンテナーはふだん 1 日以内に返信
-
Prism::Translation::Parser raises NoMethodError for a method with a &nil parameter and a body対応中かも @bbatsov が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信