EFFECT DMX modes read beyond short Art-Net/E1.31 packets
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 75/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- cpp
- 領域
- embedded-iot
調査の方向性
wled00/e131.cpp の handleDMXData() から始め、エフェクトモードと、availDMXLen を確認する隣接モードを比較してください。セグメントモードも含め、dmxChannels と dataOffset が利用可能なチャンネル範囲をどのように決定するかを追ってください。各エフェクトモードが必要なチャンネルを欠くパケットを無視し、短いパケットの場合に範囲外読み取りに至らなくなれば、修正は完了です。
索引モデルが issue の本文から書いたものです。
説明
What happened?
In wled00/e131.cpp, handleDMXData() reads fixed channel offsets in DMX_MODE_EFFECT, DMX_MODE_EFFECT_W, and their segment variants. These modes require 15 or 18 channels, but use this check before reading them:
if (dataOffset > dmxChannels - dmxEffectChannels + 1) return;
dmxEffectChannels is unsigned. If dmxChannels is below 14 or 17 respectively, the subtraction wraps, so a short packet passes the check. The later reads reach e131_data[dataOffset+14] or +17. The upstream Art-Net/E1.31 code clamps dmxChannels to the received packet length, but e131_data still points into that packet, not a full-size DMX buffer. In segment modes, dataOffset grows for each segment, so later reads can go farther beyond the packet. Other DMX modes use availDMXLen checks instead.
This is an out-of-bounds read. Out-of-range bytes can affect segment state and LED output, and a fault is possible. This path does not automatically rebroadcast those bytes over UDP; a practical information leak has not been demonstrated. There is no out-of-bounds write shown here. The included ASan reproducer is standalone, not a hardware test.
To Reproduce Bug
- Select an EFFECT DMX mode (the default
DMX_MODE_MULTIPLE_RGBis not affected), set the DMX start address to 1, configure its universe, and use unicast receive mode. - Send an Art-Net
OpDmxpacket to WLED's configurede131Port(default 5568, even for Art-Net), withart_universe == e131Universeand fewer channel bytes than the mode requires. For example, send a 20-byte packet withart_length = 2and two DMX bytes. A short E1.31 packet can reach the same code. - The short length passes the check above and
handleDMXData()reads missing channel bytes. This path is confirmed from source; device behavior has not been tested.
Expected Behavior
WLED should ignore effect data unless all 15 or 18 required channels are present at the selected offset. Check the available channel count before the subtraction.
Install Method
Binary from WLED.me
What version of WLED?
The code is present in source revisions 296eec3 and fce41f2.
Which microcontroller/board are you seeing the problem on?
ESP8266
Relevant log/trace output
Anything else?
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
- 主要言語
- C++
- スター
- 18.8k
- フォーク
- 4.4k
- 平均マージ
- 2日 19時間
- マージ済み PR(30日)
- 16
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
wled/WLED のほかの issue
-
Gravimeter: bars turn black at full volume (uint8_t(segmentSampleAvg*8) overflows)対応中かも @DedeHai が 22 日前に担当しました。 オープンbug confirmed
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug cannot reproduce
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
backburner enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
wled/WLED#4132 · コメント 5 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
discussion enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
good first issue invalid
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
DanielJerolm/gpcc#74 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
patrick-hudson/put.gd-desktop#808 ·
メンテナーはふだん 1 日以内に返信
-
DPI change is not fully handled in the cascading window on Windows対応中かも @yukawa が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 4 日以内に返信
-
enhancement Ready for final check
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
mpogue2/SquareDesk#1818 · コメント 1 件 ·
-
launch-client --save-creds creates creds/<account>/ with mode 755, not 700対応中かも @metis-sprock が今日担当しました。 オープンbacklog bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
EchoTools/nevr-runtime#1471 ·
メンテナーはふだん 1 日以内に返信