# GHSA-j646-gj5p-p45g: CefSharp affected by heap buffer overflow in WebP

> Remote attackers can execute arbitrary code via a crafted HTML page due to a heap buffer overflow in the WebP library used by CefSharp.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 21 Sep 2023

## What is GHSA-j646-gj5p-p45g?

GHSA-j646-gj5p-p45g is a memory corruption vulnerability in CefSharp.Common, published on 21 Sep 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

**Google is aware that an exploit for [CVE-2023-4863](https://www.cve.org/CVERecord?id=CVE-2023-4863) exists in the wild.**

### Description

Heap buffer overflow in WebP in Google Chrome prior to 116.0.5845.187 allowed a remote attacker to perform an out of bounds memory write via a crafted HTML page. (Chromium security severity: Critical)

### References

- https://www.cve.org/CVERecord?id=CVE-2023-4863
- https://nvd.nist.gov/vuln/detail/CVE-2023-4863
- https://www.techtarget.com/searchsecurity/news/366551978/Browser-companies-patch-critical-zero-day-vulnerability

---
**Updated**

There is another related security vulnerability. 

> There's another related CVE ([CVE-2023-5217](https://nvd.nist.gov/vuln/detail/CVE-2023-5217)) that is fixed in Chromium 117.0.5938.132. This one is triggered by WebCodecs API encoder usage, so a workaround for older versions is to disable the WebCodecs API (`--disable-blink-features=WebCodecs`).

As per https://magpcss.org/ceforum/viewtopic.php?f=6&t=19551#p54150

## Which versions are affected by GHSA-j646-gj5p-p45g?

4 open source packages ship an affected version, including CefSharp.Common and CefSharp.Common.NETCore.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `CefSharp.Common` | NuGet | All versions | 116.0.230 |
| `CefSharp.Common` | NuGet | All versions | 116.0.230 |
| `CefSharp.Common.NETCore` | NuGet | All versions | 116.0.230 |
| `CefSharp.Common.NETCore` | NuGet | All versions | 116.0.230 |

## How do I fix GHSA-j646-gj5p-p45g?

Upgrade CefSharp.Common to 116.0.230 or later.

## Is GHSA-j646-gj5p-p45g being exploited?

There is no known exploitation of GHSA-j646-gj5p-p45g in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-j646-gj5p-p45g and fix it if it is affected.

What it is: GHSA-j646-gj5p-p45g is a memory corruption vulnerability in CefSharp.Common, published on 21 Sep 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of GHSA-j646-gj5p-p45g in the wild and no public exploit code.

Affected packages and fixed versions:
- CefSharp.Common (NuGet): affected all versions; fixed in 116.0.230
- CefSharp.Common (NuGet): affected all versions; fixed in 116.0.230
- CefSharp.Common.NETCore (NuGet): affected all versions; fixed in 116.0.230
- CefSharp.Common.NETCore (NuGet): affected all versions; fixed in 116.0.230

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/GHSA-j646-gj5p-p45g/ (Markdown: https://insights.sbomify.com/GHSA-j646-gj5p-p45g/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-j646-gj5p-p45g

---
From sbomify Insights: https://insights.sbomify.com/GHSA-j646-gj5p-p45g/
Summaries are generated and may contain mistakes; the official description above is the record.
