{
  "id": "CVE-2026-41316",
  "url": "https://poc.griffinguard.io/cve/CVE-2026-41316",
  "published_at": "2026-04-24T02:35:41.16Z",
  "title": "ERB has an @_init deserialization guard bypass via def_module / def_method / def_class",
  "vendor": "ruby",
  "product": "erb",
  "cvss": {
    "score": 8.1,
    "source": "cna",
    "vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": {
    "created_at": "2026-10-13T04:16:11Z",
    "first_seen_at": "2026-11-14T11:25:11.578Z",
    "days_after_publication": 172.1,
    "repo": "5t1ck/rails-doubletap-py",
    "source": "github"
  },
  "poc_repo_count": 1,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": null,
  "description": "ERB is a templating system for Ruby. Ruby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an `@_init` instance variable guard in `ERB#result` and `ERB#run` to prevent code execution when an ERB object is reconstructed via `Marshal.load` (deserialization). However, three other public methods that also evaluate `@src` via `eval()` were not given the same guard: `ERB#def_method`, `ERB#def_module`, and `ERB#def_class`. An attacker who can trigger `Marshal.load` on untrusted data in a Ruby application that has `erb` loaded can use `ERB#def_module` (zero-arg, default parameters) as a code execution sink, bypassing the `@_init` protection entirely. ERB 4.0.3.1, 4.0.4.1, 6.0.1.1, and 6.0.4 patch the issue.",
  "cwe": "CWE-693",
  "cvss_by_source": {
    "cna": 8.1
  },
  "repos": [
    {
      "repo": "5t1ck/rails-doubletap-py",
      "url": "https://github.com/5t1ck/rails-doubletap-py",
      "created_at": "2026-10-13T04:16:11Z",
      "first_seen_at": "2026-11-14T11:25:11.578Z",
      "stars": 0,
      "is_poc": "yes",
      "kind": "listed by PoC Index",
      "suspicion_score": 0,
      "suspicious": false,
      "suspicion_reasons": [],
      "status": "analyzed",
      "owner_created_at": "2020-01-05T02:27:34Z"
    },
    {
      "repo": "khushitaliyan23june/deserialization-gadget-lab",
      "url": "https://github.com/khushitaliyan23june/deserialization-gadget-lab",
      "created_at": "2026-10-31T19:44:56Z",
      "first_seen_at": "2026-11-14T11:25:11.578Z",
      "stars": 0,
      "is_poc": "fake",
      "kind": "fake",
      "suspicion_score": 0,
      "suspicious": false,
      "suspicion_reasons": [],
      "status": "analyzed",
      "owner_created_at": "2026-01-05T12:08:58Z"
    }
  ],
  "remediation": {
    "affected": [
      {
        "vendor": "ruby",
        "product": "erb",
        "ranges": [
          "\u003c 4.0.3.1",
          "= 4.0.4",
          "\u003e= 5.0.0, \u003c 6.0.1.1",
          "\u003e= 6.0.2, \u003c 6.0.4"
        ],
        "fixed_in": [
          "4.0.3.1",
          "6.0.1.1",
          "6.0.4"
        ]
      }
    ],
    "upgrade": [
      "Upgrade erb to 4.0.3.1 or 6.0.1.1 or 6.0.4 or later."
    ],
    "references": [
      {
        "kind": "Vendor advisory",
        "url": "https://github.com/ruby/erb/security/advisories/GHSA-q339-8rmv-2mhv"
      }
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [
    {
      "method": "GET",
      "path_template": "/rails/active_storage/disk/{var}/x",
      "ports": [
        3000,
        8080
      ],
      "protocol": "http",
      "repos": [
        "5t1ck/rails-doubletap-py"
      ],
      "repo_count": 1,
      "confidence": 0.7,
      "evidence": [
        "5t1ck/rails-doubletap-py/doubletap.py:322"
      ]
    }
  ],
  "rules": []
}
