Memory Management Vulnerability in Cairo Package: CVE-2018-19876

cairo Updated 02 Oct 2025

Summary

05/12/2018
N/A
Yes i
Medium
6.5

ALPINE-CVE-2018-19876: cairo 1.16.0, in cairo_ft_apply_variations() in cairo-ft-font.c, would free memory using a free function incompatible with WebKit's fastMalloc, leading to an application crash with a "free(): invalid pointer" error. Affects cairo versions < 1.16.0-r1. Fixed in 1.16.0-r1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

Cairo is a 2D graphics library that supports multiple output devices. It provides high-quality vector graphics and is widely used in various applications for rendering graphics. The library is known for its ability to produce consistent output on different devices and supports multiple backends, including image buffers, PDF, and SVG. However, it has been identified to have a critical vulnerability that affects its memory management, specifically in the function cairo_ft_apply_variations().

Vulnerability Detail

The vulnerability, identified as CVE-2018-19876, arises from improper memory management in the cairo_ft_apply_variations() function located in cairo-ft-font.c. This flaw allows the library to free memory using a deallocation function that is incompatible with WebKit's fastMalloc. As a result, this can lead to application crashes, manifesting as a 'free(): invalid pointer' error. The implications of this vulnerability are significant, as it can cause instability in applications relying on Cairo for rendering, potentially leading to denial of service.

How To Fix

Minimum fixed version

1.16.0-r1

This is the first release that contains the fix.

sudo apk add --upgrade cairo

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, if upgrading is not immediately possible, consider isolating the application using Cairo from critical systems to minimize the impact of potential crashes. Additionally, monitor the application closely for any signs of instability.

Conclusion

CVE-2018-19876 represents a significant vulnerability in the Cairo graphics library, affecting its memory management and leading to potential application crashes. It is crucial for users to update to the patched version to mitigate risks associated with this vulnerability.

See every vulnerability recorded for cairo →

Share this vulnerability

FAQ

CVE-2018-19876 is a vulnerability in the Cairo graphics library that can lead to application crashes due to improper memory management.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

The vulnerability can cause applications that use the Cairo library to crash, leading to potential denial of service.

The CVSS score for CVE-2018-19876 is 6.5, indicating a medium severity level.

You can update the Cairo package by running the command: apk add cairo=1.16.0-r1 in your Alpine package manager.

Related vulnerabilities

Recent vulnerabilities recorded for cairo.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

1.16.0-r1

This is the first release that contains the fix.

sudo apk add --upgrade cairo

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback