# CVE-2020-35492: Memory corruption in cairo

> A stack buffer overflow in Cairo's image-compositor allows attackers to execute arbitrary code or cause denial of service via crafted input files.

- **Severity:** High 7.8 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 18 Mar 2021
- **Updated:** 13 Feb 2025
- **Also known as:** ALPINE-CVE-2020-35492, ALSA-2022:1961, CLSA-2026-1787645764, DEBIAN-CVE-2020-35492, DLA-2518-1, GHSA-65pg-7gjm-q28m, JLSEC-2025-17, MGASA-2021-0028, OESA-2021-1155, RHSA-2022:1961, RLSA-2022:1961, UBUNTU-CVE-2020-35492

## What is CVE-2020-35492?

CVE-2020-35492 is a high-severity memory corruption vulnerability in cairo, published on 18 Mar 2021. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

A flaw was found in cairo's image-compositor.c in all versions prior to 1.17.4. This flaw allows an attacker who can provide a crafted input file to cairo's image-compositor (for example, by convincing a user to open a file in an application using cairo, or if an application uses cairo on untrusted input) to cause a stack buffer overflow -> out-of-bounds WRITE. The highest impact from this vulnerability is to confidentiality, integrity, as well as system availability.

Weakness: CWE-787 (Out-of-bounds Write), CWE-121 (Stack-based Buffer Overflow)

## Which versions are affected by CVE-2020-35492?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `cairo` | AlmaLinux:8 | All versions | 1.15.12-6.el8 |
| `cairo-devel` | AlmaLinux:8 | All versions | 1.15.12-6.el8 |
| `cairo-gobject` | AlmaLinux:8 | All versions | 1.15.12-6.el8 |
| `cairo-gobject-devel` | AlmaLinux:8 | All versions | 1.15.12-6.el8 |
| `pixman` | AlmaLinux:8 | All versions | 0.38.4-2.el8 |
| `pixman-devel` | AlmaLinux:8 | All versions | 0.38.4-2.el8 |
| `cairo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.15.12-6.el8 |
| `cairo-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.15.12-6.el8 |
| `cairo-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.15.12-6.el8 |
| `cairo-devel` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.15.12-6.el8 |
| `cairo-gobject` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.15.12-6.el8 |
| `cairo-gobject-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.15.12-6.el8 |
| `cairo-gobject-devel` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.15.12-6.el8 |
| `cairo-tools-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.15.12-6.el8 |
| `cairo` | Rocky Linux:8 | All versions | 0:1.15.12-6.el8 |
| `pixman` | Rocky Linux:8 | All versions | 0:0.38.4-2.el8 |

Products: Cairographics Cairo.

## How do I fix CVE-2020-35492?

Upgrade to a fixed version.

## Is CVE-2020-35492 being exploited?

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

## Other vulnerabilities in cairo

- [CVE-2017-9814](https://insights.sbomify.com/CVE-2017-9814/): Denial of service in n/a (high 7.5)
- [CVE-2016-3190](https://insights.sbomify.com/CVE-2016-3190/): Denial of service in n/a (high 7.5)
- [CVE-2019-6461](https://insights.sbomify.com/CVE-2019-6461/): Denial of service in n/a (medium 6.5)
- [CVE-2019-6462](https://insights.sbomify.com/CVE-2019-6462/): Denial of service in n/a (medium 6.5)
- [CVE-2018-19876](https://insights.sbomify.com/CVE-2018-19876/): Use after free in n/a (medium 6.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2020-35492 and fix it if it is affected.

What it is: CVE-2020-35492 is a high-severity memory corruption vulnerability in cairo, published on 18 Mar 2021. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2020-35492 in the wild and no public exploit code.

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

## Sources

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

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