# CVE-2024-29195: Azure C SDK Integer Wraparound Vulnerability

> An attacker with a compromised Azure account can trigger an integer overflow in the Azure C SDK to achieve remote code execution on IoT devices.

- **Severity:** Medium 6.0 (`CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 26 Mar 2024
- **Updated:** 4 Aug 2024
- **Also known as:** AZL-37068, AZL-37086, AZL-70178, AZL-70310, DEBIAN-CVE-2024-29195, GHSA-m8wp-hc7w-x4xg, UBUNTU-CVE-2024-29195

## What is CVE-2024-29195?

CVE-2024-29195 is a medium-severity vulnerability in azure-c-shared-utility, published on 26 Mar 2024. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.

### Official description

The azure-c-shared-utility is a C library for AMQP/MQTT communication to Azure Cloud Services. This library may be used by the Azure IoT C SDK for communication between IoT Hub and IoT Hub devices. An attacker can cause an integer wraparound or under-allocation or heap buffer overflow due to vulnerabilities in parameter checking mechanism, by exploiting the buffer length parameter in Azure C SDK, which may lead to remote code execution. Requirements for RCE are 1. Compromised Azure account allowing malformed payloads to be sent to the device via IoT Hub service, 2. By passing IoT hub service max message payload limit of 128KB, and 3. Ability to overwrite code space with remote code. Fixed in commit https://github.com/Azure/azure-c-shared-utility/commit/1129147c38ac02ad974c4c701a1e01b2141b9fe2.

Weakness: CWE-120 (Buffer Copy without Checking Size of Input)

## Which versions are affected by CVE-2024-29195?

It affects 1 product.


Products: Microsoft Azure C Shared Utility.

## How do I fix CVE-2024-29195?

Apply the vendor's patch.

## Is CVE-2024-29195 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-29195 and fix it if it is affected.

What it is: CVE-2024-29195 is a medium-severity vulnerability in azure-c-shared-utility, published on 26 Mar 2024. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2024-29195 in the wild and no public exploit code.

Affected product: azure-c-shared-utility. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-29195/ (Markdown: https://insights.sbomify.com/CVE-2024-29195/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-29195
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-29195
- OSV: https://osv.dev/vulnerability/CVE-2024-29195

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-29195/
Summaries are generated and may contain mistakes; the official description above is the record.
