CVE-2022-27779 in libcURLinfo

Summary

by MITRE • 06/02/2022

libcurl wrongly allows cookies to be set for Top Level Domains (TLDs) if thehost name is provided with a trailing dot.curl can be told to receive and send cookies. curl's "cookie engine" can bebuilt with or without [Public Suffix List](https://publicsuffix.org/)awareness. If PSL support not provided, a more rudimentary check exists to atleast prevent cookies from being set on TLDs. This check was broken if thehost name in the URL uses a trailing dot.This can allow arbitrary sites to set cookies that then would get sent to adifferent and unrelated site or domain.

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Analysis

by VulDB Data Team • 06/06/2022

The vulnerability identified as CVE-2022-27779 affects libcurl, a widely-used open source library that provides client-side URL transfer capabilities for numerous applications and systems. This issue specifically targets the cookie handling mechanism within curl's implementation, creating a security flaw that allows improper cookie setting on top-level domains. The vulnerability arises from a logical error in the cookie engine's validation process when processing hostnames that contain trailing dots, which can lead to cross-site cookie contamination and potential security breaches.

The technical flaw stems from libcurl's cookie management system, which traditionally implements checks to prevent cookies from being set on top-level domains to avoid security issues. When the Public Suffix List (PSL) support is not enabled, curl falls back to a basic validation mechanism designed to block cookie setting on TLDs. However, this basic validation fails when the hostname in the URL includes a trailing dot, which is a valid DNS notation indicating the root zone. The broken check allows cookies to be set on TLDs such as .com, .org, or .net, even though these domains should typically be excluded from cookie storage to prevent unauthorized cross-domain cookie injection.

This vulnerability creates significant operational impact by enabling what is known as cross-site cookie poisoning. When a website with a trailing dot in its hostname is processed by curl, the cookie engine incorrectly accepts cookie setting directives that would normally be rejected. This allows malicious actors to set cookies on TLDs that would then be sent to completely different and unrelated domains. The implications extend beyond simple privacy concerns to potentially enable session hijacking, cross-site request forgery attacks, and other cookie-based exploitation techniques that can compromise user sessions and data integrity. The vulnerability affects any system using libcurl versions prior to the patched release and impacts applications that rely on curl's cookie handling for authentication and session management.

The security implications align with CWE-200, which addresses information exposure through improper cookie handling, and can be mapped to ATT&CK technique T1588.001 for credential access through cookie manipulation. Organizations using curl for web scraping, API interactions, automated testing, or any application requiring HTTP cookie management should immediately implement mitigations including upgrading to patched versions of libcurl, implementing additional validation layers, and monitoring for unauthorized cookie setting activities. The fix typically involves correcting the hostname validation logic to properly handle trailing dots and ensure that TLD cookie setting is consistently blocked regardless of hostname formatting. System administrators should also consider implementing network-level monitoring to detect anomalous cookie behavior and ensure that applications properly validate cookie sources before accepting or transmitting authentication tokens.

Reservation

03/23/2022

Disclosure

06/02/2022

Moderation

accepted

CPE

ready

EPSS

0.02414

KEV

no

Activities

very low

Sources

Do you want to use VulDB in your project?

Use the official API to access entries easily!