# CVE-2024-52296: libosdp has a null pointer deref in osdp_reply_name

> An attacker can cause a denial of service in libosdp by triggering a null pointer dereference in the osdp_reply_name function.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 12 Nov 2024
- **Updated:** 19 Nov 2024
- **Also known as:** GHSA-7945-5mcv-f2pp, PYSEC-2026-1534

## What is CVE-2024-52296?

CVE-2024-52296 is a medium-severity vulnerability in goToMain libosdp, published on 12 Nov 2024. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

libosdp is an implementation of IEC 60839-11-5 OSDP (Open Supervised Device Protocol) and provides a C library with support for C++, Rust and Python3. At ospd_common.c, on the osdp_reply_name function, any reply id between REPLY_ACK and REPLY_XRD is valid, but names array do not declare all of the range. On a case of an undefined reply id within the range, name will be null (name = names[reply_id - REPLY_ACK];). Null name will casue a crash on next line: if (name[0] == '\0') as null[0] is invalid. As this logic is not limited to a secure connection, attacker may trigger this vulnerability without any prior knowledge. This issue is fixed in 2.4.0.

Weakness: CWE-476 (NULL Pointer Dereference)

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

3 open source packages ship an affected version, including libosdp.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libosdp` | PyPI | All versions | 2.4.0 |
| `libosdp` | PyPI | All versions | 2.4.0 |
| `libosdp` | PyPI | All versions | 2.4.0 |

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

Upgrade libosdp to 2.4.0 or later.

## Is CVE-2024-52296 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2024-52296 is a medium-severity vulnerability in goToMain libosdp, published on 12 Nov 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-52296 in the wild and no public exploit code.

Affected packages and fixed versions:
- libosdp (PyPI): affected all versions; fixed in 2.4.0
- libosdp (PyPI): affected all versions; fixed in 2.4.0
- libosdp (PyPI): affected all versions; fixed in 2.4.0

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-52296/ (Markdown: https://insights.sbomify.com/CVE-2024-52296/index.md)
```

## Sources

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

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