Critical Vulnerability in Curl Package: Buffer Overflow Risk Due to Improper URL Decoding

curl Updated 02 Oct 2025

Summary

31/07/2018
N/A
Yes i
Critical
9.8

ALPINE-CVE-2016-8622: The URL percent-encoding decode function in libcurl before 7.51.0 is called curl_easy_unescape. Affects curl versions < 7.51.0-r0. Fixed in 7.51.0-r0. 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 Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Curl is a widely used command-line tool and library for transferring data with URLs. It supports various protocols, including HTTP, HTTPS, FTP, and more. Curl is known for its versatility and is commonly integrated into applications for network communication. However, it has a vulnerability related to its URL percent-encoding decode function, which can lead to severe security risks if not addressed.

Vulnerability Detail

The vulnerability, identified as CVE-2016-8622, arises from the curl_easy_unescape function in libcurl versions prior to 7.51.0. This function is responsible for decoding percent-encoded URLs. The issue occurs when the function allocates a destination buffer larger than 2GB, as it returns the new length in a signed 32-bit integer. Consequently, the length may be truncated or turned negative, leading to potential heap-based buffer overflows. This vulnerability can allow attackers to execute arbitrary code, leading to system compromise.

How To Fix

Minimum fixed version

7.51.0-r0

This is the first release that contains the fix.

sudo apk add --upgrade curl

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

Workaround

As a temporary workaround, avoid using the curl_easy_unescape function with inputs that could exceed the 2GB limit. Additionally, consider implementing input validation to ensure that URLs processed by Curl do not exceed safe length limits.

Conclusion

The vulnerability CVE-2016-8622 in the Curl package poses significant risks due to improper URL decoding, potentially leading to buffer overflows. It is crucial for users to update to the patched version 7.51.0 or later to mitigate these risks. Additionally, utilizing tools like Vulert can help in monitoring and managing vulnerabilities in open-source software.

See every vulnerability recorded for curl →

Share this vulnerability

FAQ

CVE-2016-8622 is a vulnerability in the Curl package that can lead to buffer overflow due to improper handling of URL decoding.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The risks include potential arbitrary code execution, which can lead to system compromise and unauthorized access to sensitive data.

You can update Curl by using the command apk add curl@7.51.0 for Alpine Linux users, or the equivalent command for your package manager.

Yes, Vulert provides a service that monitors and alerts for open-source vulnerabilities in your software using just a manifest file like package-lock.json.

Related vulnerabilities

Recent vulnerabilities recorded for curl.

How To Fix

Minimum fixed version

7.51.0-r0

This is the first release that contains the fix.

sudo apk add --upgrade curl

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