Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

EFFECT DMX modes read beyond short Art-Net/E1.31 packets

オープン 初心者向け
#5,940 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
cpp
領域
embedded-iot

調査の方向性

wled00/e131.cpp の handleDMXData() から始め、エフェクトモードと、availDMXLen を確認する隣接モードを比較してください。セグメントモードも含め、dmxChannels と dataOffset が利用可能なチャンネル範囲をどのように決定するかを追ってください。各エフェクトモードが必要なチャンネルを欠くパケットを無視し、短いパケットの場合に範囲外読み取りに至らなくなれば、修正は完了です。

索引モデルが issue の本文から書いたものです。

説明

bug
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
  1. Select an EFFECT DMX mode (the default DMX_MODE_MULTIPLE_RGB is not affected), set the DMX start address to 1, configure its universe, and use unicast receive mode.
  2. Send an Art-Net OpDmx packet to WLED's configured e131Port (default 5568, even for Art-Net), with art_universe == e131Universe and fewer channel bytes than the mode requires. For example, send a 20-byte packet with art_length = 2 and two DMX bytes. A short E1.31 packet can reach the same code.
  3. 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

環境構築

Codespaces で開く

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

はじめの一歩

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

wled/WLED のほかの issue

wled/WLED の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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