# CVE-2026-40386: Integer overflow in libexif

> Attackers can crash applications or leak memory by exploiting an integer underflow in libexif's MakerNote decoding logic.

- **Severity:** Medium 4.0 (`CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:L`)
- **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 Apr 2026
- **Updated:** 14 Apr 2026
- **Also known as:** ALSA-2026:22529, AZL-82682, DEBIAN-CVE-2026-40386, GHSA-p6wp-hhx9-7jj5, JLSEC-2026-152, RHSA-2026:22529, RHSA-2026:26274, RLSA-2026:22529, UBUNTU-CVE-2026-40386

## What is CVE-2026-40386?

CVE-2026-40386 is a medium-severity vulnerability in libexif, published on 12 Apr 2026. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

In libexif through 0.6.25, an integer underflow in size checking for Fuji and Olympus MakerNote decoding could be used by attackers to crash or leak information out of libexif-using programs.

Weakness: CWE-191 (Integer Underflow (Wrap or Wraparound))

## Which versions are affected by CVE-2026-40386?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libexif` | AlmaLinux:10 | All versions | 0.6.24-9.el10_2.1 |
| `libexif-devel` | AlmaLinux:10 | All versions | 0.6.24-9.el10_2.1 |
| `libexif-doc` | AlmaLinux:10 | All versions | 0.6.24-9.el10_2.1 |
| `libexif` | Red Hat:enterprise_linux:10.2 | All versions | 0:0.6.24-9.el10_2.1 |
| `libexif-debuginfo` | Red Hat:enterprise_linux:10.2 | All versions | 0:0.6.24-9.el10_2.1 |
| `libexif-debugsource` | Red Hat:enterprise_linux:10.2 | All versions | 0:0.6.24-9.el10_2.1 |
| `libexif-devel` | Red Hat:enterprise_linux:10.2 | All versions | 0:0.6.24-9.el10_2.1 |
| `libexif-doc` | Red Hat:enterprise_linux:10.2 | All versions | 0:0.6.24-9.el10_2.1 |
| `libexif` | Red Hat:enterprise_linux_eus:10.0 | All versions | 0:0.6.24-9.el10_0.1 |
| `libexif-debuginfo` | Red Hat:enterprise_linux_eus:10.0 | All versions | 0:0.6.24-9.el10_0.1 |
| `libexif-debugsource` | Red Hat:enterprise_linux_eus:10.0 | All versions | 0:0.6.24-9.el10_0.1 |
| `libexif-devel` | Red Hat:enterprise_linux_eus:10.0 | All versions | 0:0.6.24-9.el10_0.1 |
| `libexif-doc` | Red Hat:enterprise_linux_eus:10.0 | All versions | 0:0.6.24-9.el10_0.1 |
| `libexif` | Rocky Linux:10 | All versions | 0:0.6.24-9.el10_2.1 |

Products: Libexif Project Libexif.

## How do I fix CVE-2026-40386?

Apply the vendor's patch.

## Is CVE-2026-40386 being exploited?

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

## Other vulnerabilities in libexif

- [CVE-2017-7544](https://insights.sbomify.com/CVE-2017-7544/): Information disclosure in libexif (critical 9.1)
- [CVE-2018-20030](https://insights.sbomify.com/CVE-2018-20030/): Denial of service in libexif (high 7.5)
- [CVE-2012-2814](https://insights.sbomify.com/CVE-2012-2814/): Memory corruption in n/a (high 7.5)
- [CVE-2012-2840](https://insights.sbomify.com/CVE-2012-2840/): Integer overflow in n/a (high 7.5)
- [CVE-2012-2841](https://insights.sbomify.com/CVE-2012-2841/): Integer overflow in n/a (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-40386 and fix it if it is affected.

What it is: CVE-2026-40386 is a medium-severity vulnerability in libexif, published on 12 Apr 2026. 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-2026-40386 in the wild and no public exploit code.

Affected product: libexif. 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-2026-40386/ (Markdown: https://insights.sbomify.com/CVE-2026-40386/index.md)
```

## Sources

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

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