Skip to content
Heist/ feed
Back to feed
High

ruby3.1, ruby3.3 — security advisory

Type: advisorySources: OSVAdvisory ID: DEBIAN-CVE-2026-41316

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.

Products
ruby3.1, ruby3.3
Affected versions
3.1.2-7, 3.1.2-7+deb12u1, 3.1.2-7+hurd.1, 3.1.2-8, 3.1.2-8.1~exp1, 3.1.2-8.3, 3.1.2-8.4, 3.1.2-8.5, 3.3.8-2, 3.3.8-2.1, 3.3.8-2.2
Fixed versions
Not specified
CVEs
CVE-2026-41316
Confirmed fixed CVEs
Not specified
Updated in this feed
1 Nov 2026, 17:46 UTC · Revision 2

Source evidence

DEBIAN-CVE-2026-41316

core-osv · Original source

Published 24 Apr 2026, 03:16 UTC

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.

osv:DEBIAN-CVE-2026-41316

ruby3.1

Fixed versions: Not specified

ruby3.3

Fixed versions: Not specified

ruby3.3

Fixed versions: Not specified

Complete source record
{
  "id": "c367c762a2abfa8114888e3487014b094db5b4ceae7c66aea51cf7bb3be1acf6",
  "url": "https://osv.dev/vulnerability/DEBIAN-CVE-2026-41316",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "DEBIAN-CVE-2026-41316",
    "summary": "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.",
    "evidence": "osv:DEBIAN-CVE-2026-41316",
    "products": [
      {
        "name": {
          "value": "ruby3.1",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "3.1.2-7",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "3.1.2-7+deb12u1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "3.1.2-7+hurd.1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "3.1.2-8",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "3.1.2-8.1~exp1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "3.1.2-8.3",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "3.1.2-8.4",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "3.1.2-8.5",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby3.3",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "3.3.8-2",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "3.3.8-2.1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "3.3.8-2.2",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby3.3",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "3.3.8-2",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "3.3.8-2.1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "3.3.8-2.2",
            "evidence": "/affected/2/versions"
          }
        ]
      }
    ],
    "severity": "high",
    "structured": {
      "id": "DEBIAN-CVE-2026-41316",
      "aliases": [
        "DEBIAN-CVE-2026-41316"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby3.1",
            "purl": "pkg:deb/debian/ruby3.1?arch=source&distro=bookworm",
            "ecosystem": "Debian:12"
          },
          "versions": [
            "3.1.2-7",
            "3.1.2-7+deb12u1",
            "3.1.2-7+hurd.1",
            "3.1.2-8",
            "3.1.2-8.1~exp1",
            "3.1.2-8.3",
            "3.1.2-8.4",
            "3.1.2-8.5"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2026-41316.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby3.3",
            "purl": "pkg:deb/debian/ruby3.3?arch=source&distro=trixie",
            "ecosystem": "Debian:13"
          },
          "versions": [
            "3.3.8-2",
            "3.3.8-2.1",
            "3.3.8-2.2"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2026-41316.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby3.3",
            "purl": "pkg:deb/debian/ruby3.3?arch=source&distro=forky",
            "ecosystem": "Debian:14"
          },
          "versions": [
            "3.3.8-2",
            "3.3.8-2.1",
            "3.3.8-2.2"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2026-41316.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        }
      ],
      "modified": "2026-10-27T09:47:37.307786758Z",
      "provider": "osv",
      "upstream": [
        "CVE-2026-41316"
      ],
      "references": [
        "https://security-tracker.debian.org/tracker/CVE-2026-41316"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2026-41316",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 461158,
  "published_at": "2026-04-24T03:16:11.897+00:00"
}