Skip to content

fix: format string vulnerability in MQTT disconnectClient()#11

Open
haydaramru wants to merge 1 commit intohoneynet:mainfrom
haydaramru:fix/mqtt-format-string
Open

fix: format string vulnerability in MQTT disconnectClient()#11
haydaramru wants to merge 1 commit intohoneynet:mainfrom
haydaramru:fix/mqtt-format-string

Conversation

@haydaramru
Copy link
Copy Markdown

Summary

disconnectClient() in servers/mqtt_pit.c passess a formated message directly at the first argument to printf():

printf(msg);  // msg = "MQTT disconnect <ip> <time>"

Because msg includes the client’s IP address (which is attacker-controlled input), a maliciously crafted value containing format specifiers such as %s, %x, or %n may lead to application crashes or even memory corruption. This represents CWE-134 format string vulnerability.

Fix: printf("%s", msg);

This pattern is already correctly applied in other parts of the file (e.g. in lines 133, 229, 280, and 865).

@haydaramru haydaramru force-pushed the fix/mqtt-format-string branch from 655a5f5 to 80d42d4 Compare March 18, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant