Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2026-41316— ERB has an @_init deserialization guard bypass via def_module / def_method / def_class

CVSS 8.1 · High EPSS 0.11% · P29
Get alerts for future matching vulnerabilitiesLog in to subscribe

I. Basic Information for CVE-2026-41316

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
Source: NVD (National Vulnerability Database)
Vulnerability 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.
Source: NVD (National Vulnerability Database)
CVSS Information
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Source: NVD (National Vulnerability Database)
Vulnerability Type
保护机制失效
Source: NVD (National Vulnerability Database)
Vulnerability Title
ERB 安全漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
ERB是The Ruby Programming Language开源的一款嵌入式Ruby模板处理工具。 ERB存在安全漏洞,该漏洞源于ERB#def_method、ERB#def_module和ERB#def_module方法未对@src进行保护,可能导致攻击者通过Marshal.load触发反序列化时,使用ERB#def_module作为代码执行点,绕过@_init保护。以下版本受到影响:ERB 4.0.3.1之前版本、4.0.4.1之前版本、6.0.1.1之前版本和6.0.4之前版本。
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)

Affected Products

VendorProductAffected VersionsCPESubscribe
rubyerb < 4.0.3.1 -

II. Public POCs for CVE-2026-41316

#POC DescriptionSource LinkShenlong Link
AI-Generated POCPremium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2026-41316

登录查看更多情报信息。

IV. Related Vulnerabilities

V. Comments for CVE-2026-41316

No comments yet


Leave a comment