Skip to content
Heist/ feed
Back to feed
Medium

cookie for trailing dot TLD

Type: advisorySources: OSV

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

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2022-27779
Confirmed fixed CVEs
Not specified
Updated in this feed
1 Nov 2026, 09:37 UTC · Revision 1

Source evidence

cookie for trailing dot TLD

core-osv · Original source

Published 11 May 2022, 08:00 UTC

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

osv:CURL-CVE-2022-27779
Complete source record
{
  "id": "40306d0c435344203c91a88e5da4441063ef88311d3cfca7472fc580964e19d3",
  "url": "https://osv.dev/vulnerability/CURL-CVE-2022-27779",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "cookie for trailing dot TLD",
    "summary": "libcurl wrongly allows HTTP cookies to be set for Top Level Domains (TLDs) if the hostname is provided with a trailing dot. curl can be told to receive and send cookies when communicating using HTTP(S). curl's \"cookie engine\" can be built with or without [Public Suffix List](https://publicsuffix.org/) awareness. If PSL support not provided, a more rudimentary check exists to at least prevent cookies from being set on TLDs. This check was broken if the hostname in the URL uses a trailing dot. This can allow arbitrary sites to set cookies that then would get sent to a different and unrelated site or domain.",
    "evidence": "osv:CURL-CVE-2022-27779",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CURL-CVE-2022-27779",
      "aliases": [
        "CURL-CVE-2022-27779",
        "CVE-2022-27779"
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "7.82.0"
                },
                {
                  "fixed": "7.83.1"
                }
              ]
            },
            {
              "repo": "https://github.com/curl/curl.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "b27ad8e1d3e68eb3214fcbb398ca436873aa7c67"
                },
                {
                  "fixed": "7e92d12b4e6911f424678a133b19de670e183a59"
                }
              ]
            }
          ],
          "versions": [
            "7.83.0",
            "7.82.0",
            "curl-7_83_0",
            "curl-7_82_0"
          ],
          "database_specific": {
            "source": "https://curl.se/docs/CURL-CVE-2022-27779.json",
            "vanir_signatures": [
              {
                "id": "CURL-CVE-2022-27779-978a5942",
                "digest": {
                  "length": 123,
                  "function_hash": "18841187454024377606824974569439357584"
                },
                "source": "https://github.com/curl/curl.git/commit/7e92d12b4e6911f424678a133b19de670e183a59",
                "target": {
                  "file": "lib/cookie.c",
                  "function": "bad_domain"
                },
                "deprecated": false,
                "signature_type": "Function",
                "signature_version": "v1"
              },
              {
                "id": "CURL-CVE-2022-27779-eddeb5ea",
                "digest": {
                  "threshold": 0.9,
                  "line_hashes": [
                    "191950345194970261446407905643131804443",
                    "329173009489481992410983380530134186182",
                    "15521993677655441910605679844043442622",
                    "28992939665080169230070541457118691157"
                  ]
                },
                "source": "https://github.com/curl/curl.git/commit/7e92d12b4e6911f424678a133b19de670e183a59",
                "target": {
                  "file": "lib/cookie.c"
                },
                "deprecated": false,
                "signature_type": "Line",
                "signature_version": "v1"
              }
            ],
            "vanir_signatures_modified": "2026-10-25T01:04:42Z"
          }
        }
      ],
      "modified": "2026-10-25T01:04:42.925203201Z",
      "provider": "osv",
      "references": [],
      "provider_metadata": {
        "CWE": {
          "id": "CWE-201",
          "desc": "Information Exposure Through Sent Data"
        },
        "URL": "https://curl.se/docs/CVE-2022-27779.json",
        "www": "https://curl.se/docs/CVE-2022-27779.html",
        "award": {
          "amount": "2400",
          "currency": "USD"
        },
        "issue": "https://hackerone.com/reports/1553301",
        "affects": "both",
        "package": "curl",
        "severity": "Medium",
        "last_affected": "7.83.0"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-27779",
        "evidence": "/aliases"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/database_specific/severity"
  },
  "source_id": "core-osv",
  "document_id": 444280,
  "published_at": "2022-05-11T08:00:00+00:00"
}