{
  "id": "CVE-2026-27959",
  "url": "https://poc.griffinguard.io/cve/CVE-2026-27959",
  "published_at": "2026-02-26T01:45:45.668Z",
  "title": "Koa has Host Header Injection via `ctx.hostname`",
  "vendor": "koajs",
  "product": "koa",
  "cvss": {
    "score": 7.5,
    "source": "cna",
    "vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": {
    "created_at": "2026-03-09T19:22:55Z",
    "first_seen_at": "2026-11-14T14:50:35.824Z",
    "days_after_publication": 11.7,
    "repo": "mlouazir/CVE-2026-27959-mini-lab",
    "source": "github"
  },
  "poc_repo_count": 1,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": null,
  "description": "Koa is middleware for Node.js using ES2017 async functions. Prior to versions 3.1.2 and 2.16.4, Koa's `ctx.hostname` API performs naive parsing of the HTTP Host header, extracting everything before the first colon without validating the input conforms to RFC 3986 hostname syntax. When a malformed Host header containing a `@` symbol is received, `ctx.hostname` returns `evil[.]com` - an attacker-controlled value. Applications using `ctx.hostname` for URL generation, password reset links, email verification URLs, or routing decisions are vulnerable to Host header injection attacks. Versions 3.1.2 and 2.16.4 fix the issue.",
  "cwe": "CWE-20",
  "cpes": [
    "cpe:2.3:a:koajs:koa:*:*:*:*:*:node.js:*:*"
  ],
  "cvss_by_source": {
    "cna": 7.5
  },
  "repos": [
    {
      "repo": "mlouazir/CVE-2026-27959-mini-lab",
      "url": "https://github.com/mlouazir/CVE-2026-27959-mini-lab",
      "created_at": "2026-03-09T19:22:55Z",
      "first_seen_at": "2026-11-14T14:50:35.824Z",
      "stars": 0,
      "is_poc": "yes",
      "kind": "exploit",
      "suspicion_score": 15,
      "suspicious": false,
      "suspicion_reasons": [
        "no network code found (normal for a local exploit)"
      ],
      "status": "analyzed",
      "owner_created_at": "2023-11-06T13:02:08Z"
    }
  ],
  "remediation": {
    "affected": [
      {
        "vendor": "koajs",
        "product": "koa",
        "ranges": [
          "\u003e= 3.0.0, \u003c 3.1.2",
          "\u003c 2.16.4"
        ],
        "fixed_in": [
          "3.1.2",
          "2.16.4"
        ]
      }
    ],
    "upgrade": [
      "Upgrade koa to 3.1.2 or 2.16.4 or later."
    ],
    "references": [
      {
        "kind": "Vendor advisory",
        "url": "https://github.com/koajs/koa/security/advisories/GHSA-7gcc-r8m5-44qm"
      },
      {
        "kind": "Patch",
        "url": "https://github.com/koajs/koa/commit/55ab9bab044ead4e82c70a30a4f9dc0fc9c1b6df"
      },
      {
        "kind": "Patch",
        "url": "https://github.com/koajs/koa/commit/b76ddc01fdb703e51652b0fd131d16394cadcfeb"
      }
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [
    {
      "method": "GET",
      "path_template": "/",
      "headers": [
        {
          "name": "Host",
          "value": "localhost@evil.com"
        }
      ],
      "ports": [
        3000
      ],
      "protocol": "http",
      "repos": [
        "mlouazir/CVE-2026-27959-mini-lab"
      ],
      "repo_count": 1,
      "confidence": 0.6,
      "evidence": [
        "mlouazir/CVE-2026-27959-mini-lab/app.js:6"
      ]
    }
  ],
  "rules": []
}
