{
  "id": "CVE-2026-57236",
  "url": "https://poc.griffinguard.io/cve/CVE-2026-57236",
  "published_at": "2026-06-25T14:29:14.181Z",
  "title": "Nokogiri: Possible Use-After-Free when `Nokogiri::XML::Document#encoding=` raises an exception",
  "vendor": "sparklemotion",
  "product": "nokogiri",
  "cvss": {
    "score": 8.2,
    "source": "nvd",
    "vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": null,
  "poc_repo_count": 0,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": null,
  "description": "Nokogiri is an open source XML and HTML library for the Ruby programming language. Prior to 1.19.4, calling Document#encoding= with an invalid encoding (e.g., a non-string, or a string containing a null byte) raises an exception, but only after freeing the document's current encoding string without replacing it. The document is left referencing freed memory, so the next call to Document#encoding reads invalid memory, which can cause a segfault or leak freed bytes into a Ruby String. Affects the CRuby (libxml2) implementation only; JRuby is not affected. This vulnerability is fixed in 1.19.4.",
  "cwe": "CWE-416",
  "cpes": [
    "cpe:2.3:a:nokogiri:nokogiri:*:*:*:*:*:ruby:*:*"
  ],
  "cvss_by_source": {
    "cna": 1.7,
    "nvd": 8.2
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "sparklemotion",
        "product": "nokogiri",
        "ranges": [
          "\u003c 1.19.4"
        ],
        "fixed_in": [
          "1.19.4"
        ]
      }
    ],
    "upgrade": [
      "Upgrade nokogiri to 1.19.4 or later."
    ],
    "references": [
      {
        "kind": "Vendor advisory",
        "url": "https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-5v8h-3h3q-446p"
      }
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
