# CVE-2023-1999: Use after free in libwebp

> A use-after-free vulnerability in libwebp allows attackers to cause a double free, potentially leading to code execution or denial of service.

- **Severity:** Medium 5.3 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 20 Jun 2023
- **Updated:** 13 Feb 2025
- **Also known as:** ALPINE-CVE-2023-1999, ALSA-2023:2076, ALSA-2023:2078, AZL-27181, CLSA-2023-1697135462, CLSA-2023-1697136085, DEBIAN-CVE-2023-1999, DLA-3439-1, DSA-5408-1, GHSA-8x9p-cw2c-6253, JLSEC-2026-440, OESA-2023-1317, OESA-2023-1684, OESA-2023-1685, RHSA-2023:2072, RHSA-2023:2073, RHSA-2023:2075, RHSA-2023:2076, RHSA-2023:2077, RHSA-2023:2078, RHSA-2023:2084, RHSA-2023:2085, RLSA-2023:2076, RLSA-2023:2078, SUSE-SU-2023:2467-1, SUSE-SU-2023:2490-1, SUSE-SU-2023:2552-1, UBUNTU-CVE-2023-1999, USN-6078-1, USN-6078-2, openSUSE-SU-2024:13019-1

## What is CVE-2023-1999?

CVE-2023-1999 is a medium-severity use after free vulnerability in Chromium libwebp, published on 20 Jun 2023. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

There exists a use after free/double free in libwebp. An attacker can use the ApplyFiltersAndEncode() function and loop through to free best.bw and assign best = trial pointer. The second loop will then return 0 because of an Out of memory error in VP8 encoder, the pointer is still assigned to trial and the AddressSanitizer will attempt a double free.

Weakness: CWE-415 (Double Free), CWE-416 (Use After Free)

## Which versions are affected by CVE-2023-1999?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libwebp` | AlmaLinux:8 | All versions | 1.0.0-8.el8_7 |
| `libwebp-devel` | AlmaLinux:8 | All versions | 1.0.0-8.el8_7 |
| `libwebp` | AlmaLinux:9 | All versions | 1.2.0-6.el9_1 |
| `libwebp-devel` | AlmaLinux:9 | All versions | 1.2.0-6.el9_1 |
| `libwebp` | Red Hat:enterprise_linux:7::client | All versions | 0:0.3.0-11.el7 |
| `libwebp-debuginfo` | Red Hat:enterprise_linux:7::client | All versions | 0:0.3.0-11.el7 |
| `libwebp-devel` | Red Hat:enterprise_linux:7::client | All versions | 0:0.3.0-11.el7 |
| `libwebp-java` | Red Hat:enterprise_linux:7::client | All versions | 0:0.3.0-11.el7 |
| `libwebp-tools` | Red Hat:enterprise_linux:7::client | All versions | 0:0.3.0-11.el7 |
| `libwebp-debuginfo` | Red Hat:enterprise_linux:7::computenode | All versions | 0:0.3.0-11.el7 |
| `libwebp-devel` | Red Hat:enterprise_linux:7::computenode | All versions | 0:0.3.0-11.el7 |
| `libwebp-java` | Red Hat:enterprise_linux:7::computenode | All versions | 0:0.3.0-11.el7 |
| `libwebp-tools` | Red Hat:enterprise_linux:7::computenode | All versions | 0:0.3.0-11.el7 |
| `libwebp` | Red Hat:enterprise_linux:7::server | All versions | 0:0.3.0-11.el7 |
| `libwebp-debuginfo` | Red Hat:enterprise_linux:7::server | All versions | 0:0.3.0-11.el7 |
| `libwebp-devel` | Red Hat:enterprise_linux:7::server | All versions | 0:0.3.0-11.el7 |
| `libwebp-java` | Red Hat:enterprise_linux:7::server | All versions | 0:0.3.0-11.el7 |
| `libwebp-tools` | Red Hat:enterprise_linux:7::server | All versions | 0:0.3.0-11.el7 |
| `libwebp` | Red Hat:enterprise_linux:7::workstation | All versions | 0:0.3.0-11.el7 |
| `libwebp-debuginfo` | Red Hat:enterprise_linux:7::workstation | All versions | 0:0.3.0-11.el7 |
| `libwebp-devel` | Red Hat:enterprise_linux:7::workstation | All versions | 0:0.3.0-11.el7 |
| `libwebp-java` | Red Hat:enterprise_linux:7::workstation | All versions | 0:0.3.0-11.el7 |
| `libwebp-tools` | Red Hat:enterprise_linux:7::workstation | All versions | 0:0.3.0-11.el7 |
| `libwebp` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.0.0-8.el8_7 |
| `libwebp-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.0.0-8.el8_7 |
| `libwebp-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.0.0-8.el8_7 |
| `libwebp-devel` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.0.0-8.el8_7 |
| `libwebp-java-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.0.0-8.el8_7 |
| `libwebp-tools-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.0.0-8.el8_7 |
| `libwebp` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.2.0-6.el9_1 |
| `libwebp-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.2.0-6.el9_1 |
| `libwebp-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.2.0-6.el9_1 |
| `libwebp-devel` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.2.0-6.el9_1 |
| `libwebp-java-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.2.0-6.el9_1 |
| `libwebp-tools-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.2.0-6.el9_1 |
| `libwebp` | Red Hat:rhel_aus:8.2::appstream | All versions | 0:1.0.0-7.el8_2 |
| `libwebp-debuginfo` | Red Hat:rhel_aus:8.2::appstream | All versions | 0:1.0.0-7.el8_2 |
| `libwebp-debugsource` | Red Hat:rhel_aus:8.2::appstream | All versions | 0:1.0.0-7.el8_2 |
| `libwebp-devel` | Red Hat:rhel_aus:8.2::appstream | All versions | 0:1.0.0-7.el8_2 |
| `libwebp-java-debuginfo` | Red Hat:rhel_aus:8.2::appstream | All versions | 0:1.0.0-7.el8_2 |

Products: Webmproject Libwebp.

## How do I fix CVE-2023-1999?

Apply the vendor's patch.

## Is CVE-2023-1999 being exploited?

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

Public exploit code:

- https://github.com/Pazhanivelmani/webp_Android10_r33_CVE-2023-1999 (github_poc): https://github.com/Pazhanivelmani/webp_Android10_r33_CVE-2023-1999

## Other vulnerabilities in Chromium libwebp

- [CVE-2016-9969](https://insights.sbomify.com/CVE-2016-9969/): Use after free in n/a (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-1999 and fix it if it is affected.

What it is: CVE-2023-1999 is a medium-severity use after free vulnerability in Chromium libwebp, published on 20 Jun 2023. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2023-1999 in the wild and no public exploit code.

Affected product: Chromium libwebp. 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-2023-1999/ (Markdown: https://insights.sbomify.com/CVE-2023-1999/index.md)
```

## Sources

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

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