CVE-2024-10918 Stack-based Buffer Overflow in libmodbus library

Medium 4.8 Published Updated

A stack-based buffer overflow in libmodbus allows attackers to execute arbitrary code or cause denial of service via crafted Modbus responses.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-10918?

CVE-2024-10918 is a medium-severity memory corruption vulnerability in libmodbus, published on 27 Feb 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Stack-based Buffer Overflow vulnerability in libmodbus v3.1.10 allows to overflow the buffer allocated for the Modbus response if the function tries to reply to a Modbus request with an unexpected length.

Weakness: CWE-787, CWE-121

Which versions are affected by CVE-2024-10918?

It affects 1 product.

Products include Libmodbus Libmodbus.

How do I fix CVE-2024-10918?

Upgrade to a fixed version.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2024-10918 being exploited?

There is no known exploitation of CVE-2024-10918 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2024-10918, GHSA-96xh-5wq4-m4cc, JLSEC-2026-1252, UBUNTU-CVE-2024-10918.

Is CVE-2024-10918 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free