ruby erb up to 4.0.4/6.0.3 eval protection mechanism
| CVSS Meta Temp Score | Current Exploit Price (≈) | CTI Interest Score |
|---|---|---|
| 6.7 | $0-$5k | 0.00 |
Summary
A vulnerability classified as problematic has been found in ruby erb up to 4.0.4/6.0.3. The impacted element is the function eval. The manipulation leads to protection mechanism.
This vulnerability is uniquely identified as CVE-2026-41316. The attack is possible to be carried out remotely. No exploit exists.
It is recommended to upgrade the affected component.
Details
A vulnerability was found in ruby erb up to 4.0.4/6.0.3 and classified as problematic. This issue affects the function eval. The manipulation with an unknown input leads to a protection mechanism vulnerability. Using CWE to declare the problem leads to CWE-693. The product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product. Impacted is confidentiality, integrity, and availability. The summary by CVE is:
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.
It is possible to read the advisory at github.com. The identification of this vulnerability is CVE-2026-41316 since 04/20/2026. The exploitation is known to be difficult. The attack may be initiated remotely. No form of authentication is needed for a successful exploitation. Technical details of the vulnerability are known, but there is no available exploit.
The vulnerability scanner Nessus provides a plugin with the ID 314590 (Amazon Linux 2 : ruby, --advisory ALAS2-2026-3284 (ALAS-2026-3284)), which helps to determine the existence of the flaw in a target environment.
Upgrading to version 4.0.3.1, 6.0.1.1 or 6.0.4 eliminates this vulnerability.
The vulnerability is also documented in the databases at Tenable (314590), EUVD (EUVD-2026-25385) and CERT Bund (WID-SEC-2026-1187). Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.
Affected
- Red Hat Enterprise Linux
- Oracle Linux
- RESF Rocky Linux
- Open Source Ruby
- Open Source Ruby on Rails
- Amazon Linux 2
Product
Type
Vendor
Name
Version
License
Website
- Product: https://github.com/ruby/erb/
CPE 2.3
CPE 2.2
CVSSv4
VulDB Vector: 🔒VulDB Reliability: 🔍
CVSSv3
VulDB Meta Base Score: 6.8VulDB Meta Temp Score: 6.7
VulDB Base Score: 5.6
VulDB Temp Score: 5.4
VulDB Vector: 🔒
VulDB Reliability: 🔍
CNA Base Score: 8.1
CNA Vector (GitHub_M): 🔒
CVSSv2
| AV | AC | Au | C | I | A |
|---|---|---|---|---|---|
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| Vector | Complexity | Authentication | Confidentiality | Integrity | Availability |
|---|---|---|---|---|---|
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
VulDB Base Score: 🔒
VulDB Temp Score: 🔒
VulDB Reliability: 🔍
Exploiting
Class: Protection mechanismCWE: CWE-693
CAPEC: 🔒
ATT&CK: 🔒
Physical: No
Local: No
Remote: Yes
Availability: 🔒
Status: Not defined
EPSS Score: 🔒
EPSS Percentile: 🔒
Price Prediction: 🔍
Current Price Estimation: 🔒
| 0-Day | Unlock | Unlock | Unlock | Unlock |
|---|---|---|---|---|
| Today | Unlock | Unlock | Unlock | Unlock |
Nessus ID: 314590
Nessus Name: Amazon Linux 2 : ruby, --advisory ALAS2-2026-3284 (ALAS-2026-3284)
Threat Intelligence
Interest: 🔍Active Actors: 🔍
Active APT Groups: 🔍
Countermeasures
Recommended: UpgradeStatus: 🔍
0-Day Time: 🔒
Upgrade: erb 4.0.3.1/6.0.1.1/6.0.4
Timeline
04/20/2026 CVE reserved04/24/2026 Advisory disclosed
04/24/2026 VulDB entry created
07/09/2026 VulDB entry last update
Sources
Product: github.comAdvisory: GHSA-q339-8rmv-2mhv
Status: Confirmed
CVE: CVE-2026-41316 (🔒)
GCVE (CVE): GCVE-0-2026-41316
GCVE (VulDB): GCVE-100-359267
EUVD: 🔒
CERT Bund: WID-SEC-2026-1187 - Ruby und Ruby on Rails (erb gem): Schwachstelle ermöglicht Codeausführung
Entry
Created: 04/24/2026 07:44Updated: 07/09/2026 13:39
Changes: 04/24/2026 07:44 (65), 04/24/2026 18:34 (1), 05/14/2026 19:00 (2), 07/09/2026 13:39 (7)
Complete: 🔍
Cache ID: 216::103
Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.
No comments yet. Languages: en.
Please log in to comment.