DHCP server unbounded option parsing - OOB read from packet buffer
Les mainteneurs répondent en général sous 1 jour
@cms19859230182-lang y travaille déjà.
Depuis le 8/10/2026.
- #11858 par @cms19859230182-lang — ouverte
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 68/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Calme
- Stack technique
- c
- Domaine
- embedded-iot, networking, security
Piste de recherche
Commencez dans components/net/lwip-dhcpd/dhcp_server.c à la ligne 346 et suivez la manière dont sont représentées la longueur du paquet reçu et la position de l’option. Compilez le serveur DHCP avec AddressSanitizer et envoyez le paquet DHCP malformé décrit, notamment avec des marqueurs de fin manquants et des longueurs d’option excessives. Le travail est terminé lorsque les options malformées n’entraînent plus de lectures au-delà du tampon du paquet.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
RT-Thread Version
tested HEAD, commit 38c007af
Hardware Type/Architectures
independent (Bug is in lwip-dhcpd C implementation)
Develop Toolchain
Other
Describe the bug
Summary
A buffer over-read vulnerability exists in RT-Thread's DHCP server implementation (components/net/lwip-dhcpd/dhcp_server.c) where the DHCP option parsing loop has no bounds check on the input buffer position, allowing a crafted DHCP packet to read past the allocated buffer.
Details
File: components/net/lwip-dhcpd/dhcp_server.c, line 346
The DHCP options parsing loop uses while(finished == 0) to iterate through options in the received packet. The loop reads option type and length fields from the packet data but does NOT check whether the current read position exceeds the packet buffer boundary.
/* dhcp_server.c:346 */
while(finished == 0) {
/* reads option type and length from packet data */
/* NO check that position < packet_length */
}
Since DHCP packets are received over the network with no authentication, this is reachable pre-authentication on the local network segment.
PoC
Send a crafted DHCP packet on the local network segment with:
- Valid DHCP header (op=1, htype=1, hlen=6)
- Options section containing a chain of options where each option's length field points past the end of the packet
- No DHCP_OPTION_END (0xFF) marker
The server's option parsing loop will read past the packet buffer boundary until it hits unmapped memory (crash) or reads adjacent heap data (info leak).
Build and run the RT-Thread DHCP server component with AddressSanitizer enabled to observe the over-read:
# Cross-compile RT-Thread with ASAN, enable lwip-dhcpd,
# send crafted DHCP DISCOVER on the local interface
Other additional context
Impact
- Out-of-bounds read from the packet buffer
- Potential information disclosure from adjacent heap memory
- Potential crash (DoS) if reading into unmapped memory
- Affects any RT-Thread device running the built-in DHCP server
- Attack vector: adjacent network (DHCP is link-local), no authentication required
Suggested fix:
- while(finished == 0) {
+ while(finished == 0 && position < packet_length) {
Also validate that position + option_length does not exceed packet_length before reading option data.
- Langage dominant
- C
- Étoiles
- 12.3k
- Forks
- 5.5k
- Merge moyen
- 7 j 22 h
- PR mergées (30 j)
- 30
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de RT-Thread/rt-thread
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
RT-Thread/rt-thread#11902 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
[bsp][stm32][bluepill] README「快速上手」缺少重新生成 MDK 工程这一步,按文档操作无法编译通过Peut-être pris @moment-NEW l’a pris il y a 17 jours. Ouvertein progress
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
RT-Thread/rt-thread#11818 · 4 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
BSP BSP: Loongson bug RT-Smart
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
RT-Thread/rt-thread#11717 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Arch: RISC-V BSP BSP: HPMicro bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
RT-Thread/rt-thread#11687 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
RT-Thread/rt-thread#11472 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de RT-Thread/rt-thread
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
quickjs-ng/quickjs#1836 ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
open-quantum-safe/liboqs#2637 ·
Les mainteneurs répondent en général sous 1 jour
-
Go device SDK: Whisper transcriber keeps buffering and transcribing audio appended after Stop()Peut-être pris @apoorvdarshan l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
BasedHardware/omi#22770 ·
Les mainteneurs répondent en général sous 1 jour
-
fido_do_ecdh() reports any getKeyAgreement failure as FIDO_ERR_INTERNALPeut-être pris @brlumen l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
joncampbell123/dosbox-x#6698 ·
Les mainteneurs répondent en général sous 1 jour