Skip to content
Heist/ feed
Back to feed
Medium

cookies vulnerable to Set-Cookie attribute injection via unvalidated domain and path options

Type: advisorySources: OSV

cookies is a Node.js library for reading and writing HTTP cookies, used by Koa via ctx.cookies. In versions before 0.9.2 the library validates the cookie name and value against character sets that reject the semicolon separator, but the domain and path options are checked only against a permissive RFC 7230 field-content matcher that allows semicolons, and both are written into the Set-Cookie header unescaped. An application that passes untrusted or request-derived data into the domain or path option can therefore inject additional cookie attributes, overriding SameSite, Secure, HttpOnly, or Domain on the cookies the application issues. This is a Set-Cookie attribute injection issue (CWE-74). The issue is fixed in cookies 0.9.2, which validates domain and path against RFC 6265 character sets. As a workaround, keep domain and path application-set rather than derived from untrusted input.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-88038
Confirmed fixed CVEs
Not specified
Updated in this feed
6 Nov 2026, 00:03 UTC · Revision 1

Source evidence

cookies vulnerable to Set-Cookie attribute injection via unvalidated domain and path options

core-osv · Original source

Published 10 Sept 2026, 12:11 UTC

cookies is a Node.js library for reading and writing HTTP cookies, used by Koa via ctx.cookies. In versions before 0.9.2 the library validates the cookie name and value against character sets that reject the semicolon separator, but the domain and path options are checked only against a permissive RFC 7230 field-content matcher that allows semicolons, and both are written into the Set-Cookie header unescaped. An application that passes untrusted or request-derived data into the domain or path option can therefore inject additional cookie attributes, overriding SameSite, Secure, HttpOnly, or Domain on the cookies the application issues. This is a Set-Cookie attribute injection issue (CWE-74). The issue is fixed in cookies 0.9.2, which validates domain and path against RFC 6265 character sets. As a workaround, keep domain and path application-set rather than derived from untrusted input.

osv:CVE-2026-88038
Complete source record
{
  "id": "93d729e6812882a700ceffd545d939c3ddf4653a955bb12c4d919aec6a5d38f3",
  "url": "https://osv.dev/vulnerability/CVE-2026-88038",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "cookies vulnerable to Set-Cookie attribute injection via unvalidated domain and path options",
    "summary": "cookies is a Node.js library for reading and writing HTTP cookies, used by Koa via ctx.cookies. In versions before 0.9.2 the library validates the cookie name and value against character sets that reject the semicolon separator, but the domain and path options are checked only against a permissive RFC 7230 field-content matcher that allows semicolons, and both are written into the Set-Cookie header unescaped. An application that passes untrusted or request-derived data into the domain or path option can therefore inject additional cookie attributes, overriding SameSite, Secure, HttpOnly, or Domain on the cookies the application issues. This is a Set-Cookie attribute injection issue (CWE-74). The issue is fixed in cookies 0.9.2, which validates domain and path against RFC 6265 character sets. As a workaround, keep domain and path application-set rather than derived from untrusted input.",
    "evidence": "osv:CVE-2026-88038",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2026-88038",
      "aliases": [
        "CVE-2026-88038",
        "GHSA-x44v-5gxf-r6hf"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/pillarjs/cookies",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "6e35de1524bb55d5deac3edcf67c2ac374d658d0"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "0.9.2"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandardRange"
                  },
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "0.9.2"
                      }
                    ],
                    "source": "DESCRIPTION"
                  }
                ]
              }
            }
          ],
          "versions": [
            "0.9.1",
            "0.9.0",
            "0.8.0",
            "0.7.3",
            "0.7.2",
            "0.7.1",
            "0.7.0",
            "0.6.2",
            "0.6.1",
            "0.6.0",
            "0.5.1",
            "0.5.0",
            "0.4.1",
            "0.4.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-88038.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:45.434269163Z",
      "provider": "osv",
      "references": [
        "https://cna.openjsf.org/security-advisories.html",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/88xxx/CVE-2026-88038.json",
        "https://github.com/pillarjs/cookies/security/advisories/GHSA-x44v-5gxf-r6hf",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-88038"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-74"
        ],
        "cna_assigner": "openjs",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/88xxx/CVE-2026-88038.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-88038",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 513306,
  "published_at": "2026-09-10T12:11:58.674+00:00"
}