erb
An easy to use but powerful templating system for Ruby
Activity
- Latest release
- 1mo ago
- Total releases
- 29
- Cadence
- ~15 days
- Last 12 months
- 16
Reach
- Downloads
- 101.8M
- Stars
- 184
Details
- License
- unknown OR BSD-2-Clause
- First release
- Sep 18, 2020
| Version | Released | |
|---|---|---|
6.0.7
patch
| ||
6.0.6
patch
| ||
6.0.5
patch
| ||
6.0.1.1
patch
| ||
6.0.4
patch
| ||
4.0.3.1
patch
| ||
4.0.4.1
patch
| ||
6.0.3
patch
1 CVE
CVE-2026-41316
GHSA-q339-8rmv-2mhv
Apr 24, 2026
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
8.1
/ 10
High
Network
High
None
None
Unchanged
High
High
High
SummaryRuby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an
An attacker who can trigger The @_init GuardIn
In
When an ERB object is reconstructed via The Bypass
Method wrapper breakout
Proof of ConceptMinimal (ERB only)
Marshal deserialization (ERB + ActiveSupport)When combined with
Chain:
Verified on: Ruby 3.3.8 / RubyGems 3.6.7 / ActiveSupport 7.2.3 / ERB 6.0.1 ImpactScopeAny Ruby application that calls
Severity justificationThe This bypass renders the @_init mitigation ineffective across all ERB versions from 2.2.0 through 6.0.3 (latest as of April 2026). Combined with the DeprecatedInstanceVariableProxy gadget (present in all ActiveSupport versions through 7.2.3), this constitutes a universal RCE gadget chain for Ruby 3.2+ applications using Rails. Gadget chain historySix generations of Ruby Marshal gadget chains have been discovered (2018-2026). Each bypassed the previous round of mitigations: | Year | Chain | Mitigated in | |------|-------|-------------| | 2018 | Gem::Requirement (Luke Jahnke) | RubyGems 3.0 | | 2021 | UDG -- TarReader+WriteAdapter (vakzz) | RubyGems 3.1 | | 2022 | Gem::Specification._load (vakzz) | RubyGems 3.6 | | 2024 | UncaughtThrowError (Luke Jahnke) | Ruby 3.4 patches | | 2024 | Gem::Source::Git#rev_parse | RubyGems 3.6 | | 2026 | ERB#def_module @_init bypass | ERB 6.0.4 | PatchesThe problem has been patched at the following ERB versions. Please upgrade your erb.gem to any one of them.
Add the
Affected versions
2.2.0
2.2.1
2.2.2
2.2.3
3.0.0
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
5.0.0
5.0.1
+ 10 more Show less
5.0.2
5.0.3
5.1.0
5.1.1
5.1.2
5.1.3
6.0.0
6.0.1
6.0.2
6.0.3
Fixed in
4.0.3.1
4.0.4.1
6.0.1.1
6.0.4
References Updated Sep 10, 2026 · Source: OSV.dev | ||
6.0.2
patch
1 CVE
CVE-2026-41316
GHSA-q339-8rmv-2mhv
Apr 24, 2026
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
8.1
/ 10
High
Network
High
None
None
Unchanged
High
High
High
SummaryRuby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an
An attacker who can trigger The @_init GuardIn
In
When an ERB object is reconstructed via The Bypass
Method wrapper breakout
Proof of ConceptMinimal (ERB only)
Marshal deserialization (ERB + ActiveSupport)When combined with
Chain:
Verified on: Ruby 3.3.8 / RubyGems 3.6.7 / ActiveSupport 7.2.3 / ERB 6.0.1 ImpactScopeAny Ruby application that calls
Severity justificationThe This bypass renders the @_init mitigation ineffective across all ERB versions from 2.2.0 through 6.0.3 (latest as of April 2026). Combined with the DeprecatedInstanceVariableProxy gadget (present in all ActiveSupport versions through 7.2.3), this constitutes a universal RCE gadget chain for Ruby 3.2+ applications using Rails. Gadget chain historySix generations of Ruby Marshal gadget chains have been discovered (2018-2026). Each bypassed the previous round of mitigations: | Year | Chain | Mitigated in | |------|-------|-------------| | 2018 | Gem::Requirement (Luke Jahnke) | RubyGems 3.0 | | 2021 | UDG -- TarReader+WriteAdapter (vakzz) | RubyGems 3.1 | | 2022 | Gem::Specification._load (vakzz) | RubyGems 3.6 | | 2024 | UncaughtThrowError (Luke Jahnke) | Ruby 3.4 patches | | 2024 | Gem::Source::Git#rev_parse | RubyGems 3.6 | | 2026 | ERB#def_module @_init bypass | ERB 6.0.4 | PatchesThe problem has been patched at the following ERB versions. Please upgrade your erb.gem to any one of them.
Add the
Affected versions
2.2.0
2.2.1
2.2.2
2.2.3
3.0.0
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
5.0.0
5.0.1
+ 10 more Show less
5.0.2
5.0.3
5.1.0
5.1.1
5.1.2
5.1.3
6.0.0
6.0.1
6.0.2
6.0.3
Fixed in
4.0.3.1
4.0.4.1
6.0.1.1
6.0.4
References Updated Sep 10, 2026 · Source: OSV.dev | ||
6.0.1
patch
1 CVE
CVE-2026-41316
GHSA-q339-8rmv-2mhv
Apr 24, 2026
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
8.1
/ 10
High
Network
High
None
None
Unchanged
High
High
High
SummaryRuby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an
An attacker who can trigger The @_init GuardIn
In
When an ERB object is reconstructed via The Bypass
Method wrapper breakout
Proof of ConceptMinimal (ERB only)
Marshal deserialization (ERB + ActiveSupport)When combined with
Chain:
Verified on: Ruby 3.3.8 / RubyGems 3.6.7 / ActiveSupport 7.2.3 / ERB 6.0.1 ImpactScopeAny Ruby application that calls
Severity justificationThe This bypass renders the @_init mitigation ineffective across all ERB versions from 2.2.0 through 6.0.3 (latest as of April 2026). Combined with the DeprecatedInstanceVariableProxy gadget (present in all ActiveSupport versions through 7.2.3), this constitutes a universal RCE gadget chain for Ruby 3.2+ applications using Rails. Gadget chain historySix generations of Ruby Marshal gadget chains have been discovered (2018-2026). Each bypassed the previous round of mitigations: | Year | Chain | Mitigated in | |------|-------|-------------| | 2018 | Gem::Requirement (Luke Jahnke) | RubyGems 3.0 | | 2021 | UDG -- TarReader+WriteAdapter (vakzz) | RubyGems 3.1 | | 2022 | Gem::Specification._load (vakzz) | RubyGems 3.6 | | 2024 | UncaughtThrowError (Luke Jahnke) | Ruby 3.4 patches | | 2024 | Gem::Source::Git#rev_parse | RubyGems 3.6 | | 2026 | ERB#def_module @_init bypass | ERB 6.0.4 | PatchesThe problem has been patched at the following ERB versions. Please upgrade your erb.gem to any one of them.
Add the
Affected versions
2.2.0
2.2.1
2.2.2
2.2.3
3.0.0
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
5.0.0
5.0.1
+ 10 more Show less
5.0.2
5.0.3
5.1.0
5.1.1
5.1.2
5.1.3
6.0.0
6.0.1
6.0.2
6.0.3
Fixed in
4.0.3.1
4.0.4.1
6.0.1.1
6.0.4
References Updated Sep 10, 2026 · Source: OSV.dev | ||
6.0.0
major
1 CVE
CVE-2026-41316
GHSA-q339-8rmv-2mhv
Apr 24, 2026
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
8.1
/ 10
High
Network
High
None
None
Unchanged
High
High
High
SummaryRuby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an
An attacker who can trigger The @_init GuardIn
In
When an ERB object is reconstructed via The Bypass
Method wrapper breakout
Proof of ConceptMinimal (ERB only)
Marshal deserialization (ERB + ActiveSupport)When combined with
Chain:
Verified on: Ruby 3.3.8 / RubyGems 3.6.7 / ActiveSupport 7.2.3 / ERB 6.0.1 ImpactScopeAny Ruby application that calls
Severity justificationThe This bypass renders the @_init mitigation ineffective across all ERB versions from 2.2.0 through 6.0.3 (latest as of April 2026). Combined with the DeprecatedInstanceVariableProxy gadget (present in all ActiveSupport versions through 7.2.3), this constitutes a universal RCE gadget chain for Ruby 3.2+ applications using Rails. Gadget chain historySix generations of Ruby Marshal gadget chains have been discovered (2018-2026). Each bypassed the previous round of mitigations: | Year | Chain | Mitigated in | |------|-------|-------------| | 2018 | Gem::Requirement (Luke Jahnke) | RubyGems 3.0 | | 2021 | UDG -- TarReader+WriteAdapter (vakzz) | RubyGems 3.1 | | 2022 | Gem::Specification._load (vakzz) | RubyGems 3.6 | | 2024 | UncaughtThrowError (Luke Jahnke) | Ruby 3.4 patches | | 2024 | Gem::Source::Git#rev_parse | RubyGems 3.6 | | 2026 | ERB#def_module @_init bypass | ERB 6.0.4 | PatchesThe problem has been patched at the following ERB versions. Please upgrade your erb.gem to any one of them.
Add the
Affected versions
2.2.0
2.2.1
2.2.2
2.2.3
3.0.0
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
5.0.0
5.0.1
+ 10 more Show less
5.0.2
5.0.3
5.1.0
5.1.1
5.1.2
5.1.3
6.0.0
6.0.1
6.0.2
6.0.3
Fixed in
4.0.3.1
4.0.4.1
6.0.1.1
6.0.4
References Updated Sep 10, 2026 · Source: OSV.dev | ||
5.1.2
patch
1 CVE
CVE-2026-41316
GHSA-q339-8rmv-2mhv
Apr 24, 2026
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
8.1
/ 10
High
Network
High
None
None
Unchanged
High
High
High
SummaryRuby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an
An attacker who can trigger The @_init GuardIn
In
When an ERB object is reconstructed via The Bypass
Method wrapper breakout
Proof of ConceptMinimal (ERB only)
Marshal deserialization (ERB + ActiveSupport)When combined with
Chain:
Verified on: Ruby 3.3.8 / RubyGems 3.6.7 / ActiveSupport 7.2.3 / ERB 6.0.1 ImpactScopeAny Ruby application that calls
Severity justificationThe This bypass renders the @_init mitigation ineffective across all ERB versions from 2.2.0 through 6.0.3 (latest as of April 2026). Combined with the DeprecatedInstanceVariableProxy gadget (present in all ActiveSupport versions through 7.2.3), this constitutes a universal RCE gadget chain for Ruby 3.2+ applications using Rails. Gadget chain historySix generations of Ruby Marshal gadget chains have been discovered (2018-2026). Each bypassed the previous round of mitigations: | Year | Chain | Mitigated in | |------|-------|-------------| | 2018 | Gem::Requirement (Luke Jahnke) | RubyGems 3.0 | | 2021 | UDG -- TarReader+WriteAdapter (vakzz) | RubyGems 3.1 | | 2022 | Gem::Specification._load (vakzz) | RubyGems 3.6 | | 2024 | UncaughtThrowError (Luke Jahnke) | Ruby 3.4 patches | | 2024 | Gem::Source::Git#rev_parse | RubyGems 3.6 | | 2026 | ERB#def_module @_init bypass | ERB 6.0.4 | PatchesThe problem has been patched at the following ERB versions. Please upgrade your erb.gem to any one of them.
Add the
Affected versions
2.2.0
2.2.1
2.2.2
2.2.3
3.0.0
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
5.0.0
5.0.1
+ 10 more Show less
5.0.2
5.0.3
5.1.0
5.1.1
5.1.2
5.1.3
6.0.0
6.0.1
6.0.2
6.0.3
Fixed in
4.0.3.1
4.0.4.1
6.0.1.1
6.0.4
References Updated Sep 10, 2026 · Source: OSV.dev | ||
5.1.3
patch
1 CVE
CVE-2026-41316
GHSA-q339-8rmv-2mhv
Apr 24, 2026
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
8.1
/ 10
High
Network
High
None
None
Unchanged
High
High
High
SummaryRuby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an
An attacker who can trigger The @_init GuardIn
In
When an ERB object is reconstructed via The Bypass
Method wrapper breakout
Proof of ConceptMinimal (ERB only)
Marshal deserialization (ERB + ActiveSupport)When combined with
Chain:
Verified on: Ruby 3.3.8 / RubyGems 3.6.7 / ActiveSupport 7.2.3 / ERB 6.0.1 ImpactScopeAny Ruby application that calls
Severity justificationThe This bypass renders the @_init mitigation ineffective across all ERB versions from 2.2.0 through 6.0.3 (latest as of April 2026). Combined with the DeprecatedInstanceVariableProxy gadget (present in all ActiveSupport versions through 7.2.3), this constitutes a universal RCE gadget chain for Ruby 3.2+ applications using Rails. Gadget chain historySix generations of Ruby Marshal gadget chains have been discovered (2018-2026). Each bypassed the previous round of mitigations: | Year | Chain | Mitigated in | |------|-------|-------------| | 2018 | Gem::Requirement (Luke Jahnke) | RubyGems 3.0 | | 2021 | UDG -- TarReader+WriteAdapter (vakzz) | RubyGems 3.1 | | 2022 | Gem::Specification._load (vakzz) | RubyGems 3.6 | | 2024 | UncaughtThrowError (Luke Jahnke) | Ruby 3.4 patches | | 2024 | Gem::Source::Git#rev_parse | RubyGems 3.6 | | 2026 | ERB#def_module @_init bypass | ERB 6.0.4 | PatchesThe problem has been patched at the following ERB versions. Please upgrade your erb.gem to any one of them.
Add the
Affected versions
2.2.0
2.2.1
2.2.2
2.2.3
3.0.0
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
5.0.0
5.0.1
+ 10 more Show less
5.0.2
5.0.3
5.1.0
5.1.1
5.1.2
5.1.3
6.0.0
6.0.1
6.0.2
6.0.3
Fixed in
4.0.3.1
4.0.4.1
6.0.1.1
6.0.4
References Updated Sep 10, 2026 · Source: OSV.dev | ||
5.1.1
patch
1 CVE
CVE-2026-41316
GHSA-q339-8rmv-2mhv
Apr 24, 2026
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
8.1
/ 10
High
Network
High
None
None
Unchanged
High
High
High
SummaryRuby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an
An attacker who can trigger The @_init GuardIn
In
When an ERB object is reconstructed via The Bypass
Method wrapper breakout
Proof of ConceptMinimal (ERB only)
Marshal deserialization (ERB + ActiveSupport)When combined with
Chain:
Verified on: Ruby 3.3.8 / RubyGems 3.6.7 / ActiveSupport 7.2.3 / ERB 6.0.1 ImpactScopeAny Ruby application that calls
Severity justificationThe This bypass renders the @_init mitigation ineffective across all ERB versions from 2.2.0 through 6.0.3 (latest as of April 2026). Combined with the DeprecatedInstanceVariableProxy gadget (present in all ActiveSupport versions through 7.2.3), this constitutes a universal RCE gadget chain for Ruby 3.2+ applications using Rails. Gadget chain historySix generations of Ruby Marshal gadget chains have been discovered (2018-2026). Each bypassed the previous round of mitigations: | Year | Chain | Mitigated in | |------|-------|-------------| | 2018 | Gem::Requirement (Luke Jahnke) | RubyGems 3.0 | | 2021 | UDG -- TarReader+WriteAdapter (vakzz) | RubyGems 3.1 | | 2022 | Gem::Specification._load (vakzz) | RubyGems 3.6 | | 2024 | UncaughtThrowError (Luke Jahnke) | Ruby 3.4 patches | | 2024 | Gem::Source::Git#rev_parse | RubyGems 3.6 | | 2026 | ERB#def_module @_init bypass | ERB 6.0.4 | PatchesThe problem has been patched at the following ERB versions. Please upgrade your erb.gem to any one of them.
Add the
Affected versions
2.2.0
2.2.1
2.2.2
2.2.3
3.0.0
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
5.0.0
5.0.1
+ 10 more Show less
5.0.2
5.0.3
5.1.0
5.1.1
5.1.2
5.1.3
6.0.0
6.0.1
6.0.2
6.0.3
Fixed in
4.0.3.1
4.0.4.1
6.0.1.1
6.0.4
References Updated Sep 10, 2026 · Source: OSV.dev | ||
5.1.0
minor
1 CVE
CVE-2026-41316
GHSA-q339-8rmv-2mhv
Apr 24, 2026
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
8.1
/ 10
High
Network
High
None
None
Unchanged
High
High
High
SummaryRuby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an
An attacker who can trigger The @_init GuardIn
In
When an ERB object is reconstructed via The Bypass
Method wrapper breakout
Proof of ConceptMinimal (ERB only)
Marshal deserialization (ERB + ActiveSupport)When combined with
Chain:
Verified on: Ruby 3.3.8 / RubyGems 3.6.7 / ActiveSupport 7.2.3 / ERB 6.0.1 ImpactScopeAny Ruby application that calls
Severity justificationThe This bypass renders the @_init mitigation ineffective across all ERB versions from 2.2.0 through 6.0.3 (latest as of April 2026). Combined with the DeprecatedInstanceVariableProxy gadget (present in all ActiveSupport versions through 7.2.3), this constitutes a universal RCE gadget chain for Ruby 3.2+ applications using Rails. Gadget chain historySix generations of Ruby Marshal gadget chains have been discovered (2018-2026). Each bypassed the previous round of mitigations: | Year | Chain | Mitigated in | |------|-------|-------------| | 2018 | Gem::Requirement (Luke Jahnke) | RubyGems 3.0 | | 2021 | UDG -- TarReader+WriteAdapter (vakzz) | RubyGems 3.1 | | 2022 | Gem::Specification._load (vakzz) | RubyGems 3.6 | | 2024 | UncaughtThrowError (Luke Jahnke) | Ruby 3.4 patches | | 2024 | Gem::Source::Git#rev_parse | RubyGems 3.6 | | 2026 | ERB#def_module @_init bypass | ERB 6.0.4 | PatchesThe problem has been patched at the following ERB versions. Please upgrade your erb.gem to any one of them.
Add the
Affected versions
2.2.0
2.2.1
2.2.2
2.2.3
3.0.0
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
5.0.0
5.0.1
+ 10 more Show less
5.0.2
5.0.3
5.1.0
5.1.1
5.1.2
5.1.3
6.0.0
6.0.1
6.0.2
6.0.3
Fixed in
4.0.3.1
4.0.4.1
6.0.1.1
6.0.4
References Updated Sep 10, 2026 · Source: OSV.dev | ||
5.0.3
patch
1 CVE
CVE-2026-41316
GHSA-q339-8rmv-2mhv
Apr 24, 2026
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
8.1
/ 10
High
Network
High
None
None
Unchanged
High
High
High
SummaryRuby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an
An attacker who can trigger The @_init GuardIn
In
When an ERB object is reconstructed via The Bypass
Method wrapper breakout
Proof of ConceptMinimal (ERB only)
Marshal deserialization (ERB + ActiveSupport)When combined with
Chain:
Verified on: Ruby 3.3.8 / RubyGems 3.6.7 / ActiveSupport 7.2.3 / ERB 6.0.1 ImpactScopeAny Ruby application that calls
Severity justificationThe This bypass renders the @_init mitigation ineffective across all ERB versions from 2.2.0 through 6.0.3 (latest as of April 2026). Combined with the DeprecatedInstanceVariableProxy gadget (present in all ActiveSupport versions through 7.2.3), this constitutes a universal RCE gadget chain for Ruby 3.2+ applications using Rails. Gadget chain historySix generations of Ruby Marshal gadget chains have been discovered (2018-2026). Each bypassed the previous round of mitigations: | Year | Chain | Mitigated in | |------|-------|-------------| | 2018 | Gem::Requirement (Luke Jahnke) | RubyGems 3.0 | | 2021 | UDG -- TarReader+WriteAdapter (vakzz) | RubyGems 3.1 | | 2022 | Gem::Specification._load (vakzz) | RubyGems 3.6 | | 2024 | UncaughtThrowError (Luke Jahnke) | Ruby 3.4 patches | | 2024 | Gem::Source::Git#rev_parse | RubyGems 3.6 | | 2026 | ERB#def_module @_init bypass | ERB 6.0.4 | PatchesThe problem has been patched at the following ERB versions. Please upgrade your erb.gem to any one of them.
Add the
Affected versions
2.2.0
2.2.1
2.2.2
2.2.3
3.0.0
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
5.0.0
5.0.1
+ 10 more Show less
5.0.2
5.0.3
5.1.0
5.1.1
5.1.2
5.1.3
6.0.0
6.0.1
6.0.2
6.0.3
Fixed in
4.0.3.1
4.0.4.1
6.0.1.1
6.0.4
References Updated Sep 10, 2026 · Source: OSV.dev | ||
5.0.2
patch
1 CVE
CVE-2026-41316
GHSA-q339-8rmv-2mhv
Apr 24, 2026
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
8.1
/ 10
High
Network
High
None
None
Unchanged
High
High
High
SummaryRuby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an
An attacker who can trigger The @_init GuardIn
In
When an ERB object is reconstructed via The Bypass
Method wrapper breakout
Proof of ConceptMinimal (ERB only)
Marshal deserialization (ERB + ActiveSupport)When combined with
Chain:
Verified on: Ruby 3.3.8 / RubyGems 3.6.7 / ActiveSupport 7.2.3 / ERB 6.0.1 ImpactScopeAny Ruby application that calls
Severity justificationThe This bypass renders the @_init mitigation ineffective across all ERB versions from 2.2.0 through 6.0.3 (latest as of April 2026). Combined with the DeprecatedInstanceVariableProxy gadget (present in all ActiveSupport versions through 7.2.3), this constitutes a universal RCE gadget chain for Ruby 3.2+ applications using Rails. Gadget chain historySix generations of Ruby Marshal gadget chains have been discovered (2018-2026). Each bypassed the previous round of mitigations: | Year | Chain | Mitigated in | |------|-------|-------------| | 2018 | Gem::Requirement (Luke Jahnke) | RubyGems 3.0 | | 2021 | UDG -- TarReader+WriteAdapter (vakzz) | RubyGems 3.1 | | 2022 | Gem::Specification._load (vakzz) | RubyGems 3.6 | | 2024 | UncaughtThrowError (Luke Jahnke) | Ruby 3.4 patches | | 2024 | Gem::Source::Git#rev_parse | RubyGems 3.6 | | 2026 | ERB#def_module @_init bypass | ERB 6.0.4 | PatchesThe problem has been patched at the following ERB versions. Please upgrade your erb.gem to any one of them.
Add the
Affected versions
2.2.0
2.2.1
2.2.2
2.2.3
3.0.0
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
5.0.0
5.0.1
+ 10 more Show less
5.0.2
5.0.3
5.1.0
5.1.1
5.1.2
5.1.3
6.0.0
6.0.1
6.0.2
6.0.3
Fixed in
4.0.3.1
4.0.4.1
6.0.1.1
6.0.4
References Updated Sep 10, 2026 · Source: OSV.dev | ||
5.0.1
patch
1 CVE
CVE-2026-41316
GHSA-q339-8rmv-2mhv
Apr 24, 2026
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
8.1
/ 10
High
Network
High
None
None
Unchanged
High
High
High
SummaryRuby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an
An attacker who can trigger The @_init GuardIn
In
When an ERB object is reconstructed via The Bypass
Method wrapper breakout
Proof of ConceptMinimal (ERB only)
Marshal deserialization (ERB + ActiveSupport)When combined with
Chain:
Verified on: Ruby 3.3.8 / RubyGems 3.6.7 / ActiveSupport 7.2.3 / ERB 6.0.1 ImpactScopeAny Ruby application that calls
Severity justificationThe This bypass renders the @_init mitigation ineffective across all ERB versions from 2.2.0 through 6.0.3 (latest as of April 2026). Combined with the DeprecatedInstanceVariableProxy gadget (present in all ActiveSupport versions through 7.2.3), this constitutes a universal RCE gadget chain for Ruby 3.2+ applications using Rails. Gadget chain historySix generations of Ruby Marshal gadget chains have been discovered (2018-2026). Each bypassed the previous round of mitigations: | Year | Chain | Mitigated in | |------|-------|-------------| | 2018 | Gem::Requirement (Luke Jahnke) | RubyGems 3.0 | | 2021 | UDG -- TarReader+WriteAdapter (vakzz) | RubyGems 3.1 | | 2022 | Gem::Specification._load (vakzz) | RubyGems 3.6 | | 2024 | UncaughtThrowError (Luke Jahnke) | Ruby 3.4 patches | | 2024 | Gem::Source::Git#rev_parse | RubyGems 3.6 | | 2026 | ERB#def_module @_init bypass | ERB 6.0.4 | PatchesThe problem has been patched at the following ERB versions. Please upgrade your erb.gem to any one of them.
Add the
Affected versions
2.2.0
2.2.1
2.2.2
2.2.3
3.0.0
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
5.0.0
5.0.1
+ 10 more Show less
5.0.2
5.0.3
5.1.0
5.1.1
5.1.2
5.1.3
6.0.0
6.0.1
6.0.2
6.0.3
Fixed in
4.0.3.1
4.0.4.1
6.0.1.1
6.0.4
References Updated Sep 10, 2026 · Source: OSV.dev | ||
5.0.0
major
1 CVE
CVE-2026-41316
GHSA-q339-8rmv-2mhv
Apr 24, 2026
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
8.1
/ 10
High
Network
High
None
None
Unchanged
High
High
High
SummaryRuby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an
An attacker who can trigger The @_init GuardIn
In
When an ERB object is reconstructed via The Bypass
Method wrapper breakout
Proof of ConceptMinimal (ERB only)
Marshal deserialization (ERB + ActiveSupport)When combined with
Chain:
Verified on: Ruby 3.3.8 / RubyGems 3.6.7 / ActiveSupport 7.2.3 / ERB 6.0.1 ImpactScopeAny Ruby application that calls
Severity justificationThe This bypass renders the @_init mitigation ineffective across all ERB versions from 2.2.0 through 6.0.3 (latest as of April 2026). Combined with the DeprecatedInstanceVariableProxy gadget (present in all ActiveSupport versions through 7.2.3), this constitutes a universal RCE gadget chain for Ruby 3.2+ applications using Rails. Gadget chain historySix generations of Ruby Marshal gadget chains have been discovered (2018-2026). Each bypassed the previous round of mitigations: | Year | Chain | Mitigated in | |------|-------|-------------| | 2018 | Gem::Requirement (Luke Jahnke) | RubyGems 3.0 | | 2021 | UDG -- TarReader+WriteAdapter (vakzz) | RubyGems 3.1 | | 2022 | Gem::Specification._load (vakzz) | RubyGems 3.6 | | 2024 | UncaughtThrowError (Luke Jahnke) | Ruby 3.4 patches | | 2024 | Gem::Source::Git#rev_parse | RubyGems 3.6 | | 2026 | ERB#def_module @_init bypass | ERB 6.0.4 | PatchesThe problem has been patched at the following ERB versions. Please upgrade your erb.gem to any one of them.
Add the
Affected versions
2.2.0
2.2.1
2.2.2
2.2.3
3.0.0
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
5.0.0
5.0.1
+ 10 more Show less
5.0.2
5.0.3
5.1.0
5.1.1
5.1.2
5.1.3
6.0.0
6.0.1
6.0.2
6.0.3
Fixed in
4.0.3.1
4.0.4.1
6.0.1.1
6.0.4
References Updated Sep 10, 2026 · Source: OSV.dev | ||
4.0.3
patch
1 CVE
CVE-2026-41316
GHSA-q339-8rmv-2mhv
Apr 24, 2026
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
8.1
/ 10
High
Network
High
None
None
Unchanged
High
High
High
SummaryRuby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an
An attacker who can trigger The @_init GuardIn
In
When an ERB object is reconstructed via The Bypass
Method wrapper breakout
Proof of ConceptMinimal (ERB only)
Marshal deserialization (ERB + ActiveSupport)When combined with
Chain:
Verified on: Ruby 3.3.8 / RubyGems 3.6.7 / ActiveSupport 7.2.3 / ERB 6.0.1 ImpactScopeAny Ruby application that calls
Severity justificationThe This bypass renders the @_init mitigation ineffective across all ERB versions from 2.2.0 through 6.0.3 (latest as of April 2026). Combined with the DeprecatedInstanceVariableProxy gadget (present in all ActiveSupport versions through 7.2.3), this constitutes a universal RCE gadget chain for Ruby 3.2+ applications using Rails. Gadget chain historySix generations of Ruby Marshal gadget chains have been discovered (2018-2026). Each bypassed the previous round of mitigations: | Year | Chain | Mitigated in | |------|-------|-------------| | 2018 | Gem::Requirement (Luke Jahnke) | RubyGems 3.0 | | 2021 | UDG -- TarReader+WriteAdapter (vakzz) | RubyGems 3.1 | | 2022 | Gem::Specification._load (vakzz) | RubyGems 3.6 | | 2024 | UncaughtThrowError (Luke Jahnke) | Ruby 3.4 patches | | 2024 | Gem::Source::Git#rev_parse | RubyGems 3.6 | | 2026 | ERB#def_module @_init bypass | ERB 6.0.4 | PatchesThe problem has been patched at the following ERB versions. Please upgrade your erb.gem to any one of them.
Add the
Affected versions
2.2.0
2.2.1
2.2.2
2.2.3
3.0.0
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
5.0.0
5.0.1
+ 10 more Show less
5.0.2
5.0.3
5.1.0
5.1.1
5.1.2
5.1.3
6.0.0
6.0.1
6.0.2
6.0.3
Fixed in
4.0.3.1
4.0.4.1
6.0.1.1
6.0.4
References Updated Sep 10, 2026 · Source: OSV.dev | ||
4.0.4
patch
1 CVE
CVE-2026-41316
GHSA-q339-8rmv-2mhv
Apr 24, 2026
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
8.1
/ 10
High
Network
High
None
None
Unchanged
High
High
High
SummaryRuby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an
An attacker who can trigger The @_init GuardIn
In
When an ERB object is reconstructed via The Bypass
Method wrapper breakout
Proof of ConceptMinimal (ERB only)
Marshal deserialization (ERB + ActiveSupport)When combined with
Chain:
Verified on: Ruby 3.3.8 / RubyGems 3.6.7 / ActiveSupport 7.2.3 / ERB 6.0.1 ImpactScopeAny Ruby application that calls
Severity justificationThe This bypass renders the @_init mitigation ineffective across all ERB versions from 2.2.0 through 6.0.3 (latest as of April 2026). Combined with the DeprecatedInstanceVariableProxy gadget (present in all ActiveSupport versions through 7.2.3), this constitutes a universal RCE gadget chain for Ruby 3.2+ applications using Rails. Gadget chain historySix generations of Ruby Marshal gadget chains have been discovered (2018-2026). Each bypassed the previous round of mitigations: | Year | Chain | Mitigated in | |------|-------|-------------| | 2018 | Gem::Requirement (Luke Jahnke) | RubyGems 3.0 | | 2021 | UDG -- TarReader+WriteAdapter (vakzz) | RubyGems 3.1 | | 2022 | Gem::Specification._load (vakzz) | RubyGems 3.6 | | 2024 | UncaughtThrowError (Luke Jahnke) | Ruby 3.4 patches | | 2024 | Gem::Source::Git#rev_parse | RubyGems 3.6 | | 2026 | ERB#def_module @_init bypass | ERB 6.0.4 | PatchesThe problem has been patched at the following ERB versions. Please upgrade your erb.gem to any one of them.
Add the
Affected versions
2.2.0
2.2.1
2.2.2
2.2.3
3.0.0
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
5.0.0
5.0.1
+ 10 more Show less
5.0.2
5.0.3
5.1.0
5.1.1
5.1.2
5.1.3
6.0.0
6.0.1
6.0.2
6.0.3
Fixed in
4.0.3.1
4.0.4.1
6.0.1.1
6.0.4
References Updated Sep 10, 2026 · Source: OSV.dev | ||
4.0.2
patch
1 CVE
CVE-2026-41316
GHSA-q339-8rmv-2mhv
Apr 24, 2026
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
8.1
/ 10
High
Network
High
None
None
Unchanged
High
High
High
SummaryRuby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an
An attacker who can trigger The @_init GuardIn
In
When an ERB object is reconstructed via The Bypass
Method wrapper breakout
Proof of ConceptMinimal (ERB only)
Marshal deserialization (ERB + ActiveSupport)When combined with
Chain:
Verified on: Ruby 3.3.8 / RubyGems 3.6.7 / ActiveSupport 7.2.3 / ERB 6.0.1 ImpactScopeAny Ruby application that calls
Severity justificationThe This bypass renders the @_init mitigation ineffective across all ERB versions from 2.2.0 through 6.0.3 (latest as of April 2026). Combined with the DeprecatedInstanceVariableProxy gadget (present in all ActiveSupport versions through 7.2.3), this constitutes a universal RCE gadget chain for Ruby 3.2+ applications using Rails. Gadget chain historySix generations of Ruby Marshal gadget chains have been discovered (2018-2026). Each bypassed the previous round of mitigations: | Year | Chain | Mitigated in | |------|-------|-------------| | 2018 | Gem::Requirement (Luke Jahnke) | RubyGems 3.0 | | 2021 | UDG -- TarReader+WriteAdapter (vakzz) | RubyGems 3.1 | | 2022 | Gem::Specification._load (vakzz) | RubyGems 3.6 | | 2024 | UncaughtThrowError (Luke Jahnke) | Ruby 3.4 patches | | 2024 | Gem::Source::Git#rev_parse | RubyGems 3.6 | | 2026 | ERB#def_module @_init bypass | ERB 6.0.4 | PatchesThe problem has been patched at the following ERB versions. Please upgrade your erb.gem to any one of them.
Add the
Affected versions
2.2.0
2.2.1
2.2.2
2.2.3
3.0.0
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
5.0.0
5.0.1
+ 10 more Show less
5.0.2
5.0.3
5.1.0
5.1.1
5.1.2
5.1.3
6.0.0
6.0.1
6.0.2
6.0.3
Fixed in
4.0.3.1
4.0.4.1
6.0.1.1
6.0.4
References Updated Sep 10, 2026 · Source: OSV.dev | ||
4.0.1
patch
1 CVE
CVE-2026-41316
GHSA-q339-8rmv-2mhv
Apr 24, 2026
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
8.1
/ 10
High
Network
High
None
None
Unchanged
High
High
High
SummaryRuby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an
An attacker who can trigger The @_init GuardIn
In
When an ERB object is reconstructed via The Bypass
Method wrapper breakout
Proof of ConceptMinimal (ERB only)
Marshal deserialization (ERB + ActiveSupport)When combined with
Chain:
Verified on: Ruby 3.3.8 / RubyGems 3.6.7 / ActiveSupport 7.2.3 / ERB 6.0.1 ImpactScopeAny Ruby application that calls
Severity justificationThe This bypass renders the @_init mitigation ineffective across all ERB versions from 2.2.0 through 6.0.3 (latest as of April 2026). Combined with the DeprecatedInstanceVariableProxy gadget (present in all ActiveSupport versions through 7.2.3), this constitutes a universal RCE gadget chain for Ruby 3.2+ applications using Rails. Gadget chain historySix generations of Ruby Marshal gadget chains have been discovered (2018-2026). Each bypassed the previous round of mitigations: | Year | Chain | Mitigated in | |------|-------|-------------| | 2018 | Gem::Requirement (Luke Jahnke) | RubyGems 3.0 | | 2021 | UDG -- TarReader+WriteAdapter (vakzz) | RubyGems 3.1 | | 2022 | Gem::Specification._load (vakzz) | RubyGems 3.6 | | 2024 | UncaughtThrowError (Luke Jahnke) | Ruby 3.4 patches | | 2024 | Gem::Source::Git#rev_parse | RubyGems 3.6 | | 2026 | ERB#def_module @_init bypass | ERB 6.0.4 | PatchesThe problem has been patched at the following ERB versions. Please upgrade your erb.gem to any one of them.
Add the
Affected versions
2.2.0
2.2.1
2.2.2
2.2.3
3.0.0
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
5.0.0
5.0.1
+ 10 more Show less
5.0.2
5.0.3
5.1.0
5.1.1
5.1.2
5.1.3
6.0.0
6.0.1
6.0.2
6.0.3
Fixed in
4.0.3.1
4.0.4.1
6.0.1.1
6.0.4
References Updated Sep 10, 2026 · Source: OSV.dev | ||
4.0.0
major
1 CVE
CVE-2026-41316
GHSA-q339-8rmv-2mhv
Apr 24, 2026
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
8.1
/ 10
High
Network
High
None
None
Unchanged
High
High
High
SummaryRuby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an
An attacker who can trigger The @_init GuardIn
In
When an ERB object is reconstructed via The Bypass
Method wrapper breakout
Proof of ConceptMinimal (ERB only)
Marshal deserialization (ERB + ActiveSupport)When combined with
Chain:
Verified on: Ruby 3.3.8 / RubyGems 3.6.7 / ActiveSupport 7.2.3 / ERB 6.0.1 ImpactScopeAny Ruby application that calls
Severity justificationThe This bypass renders the @_init mitigation ineffective across all ERB versions from 2.2.0 through 6.0.3 (latest as of April 2026). Combined with the DeprecatedInstanceVariableProxy gadget (present in all ActiveSupport versions through 7.2.3), this constitutes a universal RCE gadget chain for Ruby 3.2+ applications using Rails. Gadget chain historySix generations of Ruby Marshal gadget chains have been discovered (2018-2026). Each bypassed the previous round of mitigations: | Year | Chain | Mitigated in | |------|-------|-------------| | 2018 | Gem::Requirement (Luke Jahnke) | RubyGems 3.0 | | 2021 | UDG -- TarReader+WriteAdapter (vakzz) | RubyGems 3.1 | | 2022 | Gem::Specification._load (vakzz) | RubyGems 3.6 | | 2024 | UncaughtThrowError (Luke Jahnke) | Ruby 3.4 patches | | 2024 | Gem::Source::Git#rev_parse | RubyGems 3.6 | | 2026 | ERB#def_module @_init bypass | ERB 6.0.4 | PatchesThe problem has been patched at the following ERB versions. Please upgrade your erb.gem to any one of them.
Add the
Affected versions
2.2.0
2.2.1
2.2.2
2.2.3
3.0.0
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
5.0.0
5.0.1
+ 10 more Show less
5.0.2
5.0.3
5.1.0
5.1.1
5.1.2
5.1.3
6.0.0
6.0.1
6.0.2
6.0.3
Fixed in
4.0.3.1
4.0.4.1
6.0.1.1
6.0.4
References Updated Sep 10, 2026 · Source: OSV.dev | ||
3.0.0
major
1 CVE
CVE-2026-41316
GHSA-q339-8rmv-2mhv
Apr 24, 2026
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
8.1
/ 10
High
Network
High
None
None
Unchanged
High
High
High
SummaryRuby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an
An attacker who can trigger The @_init GuardIn
In
When an ERB object is reconstructed via The Bypass
Method wrapper breakout
Proof of ConceptMinimal (ERB only)
Marshal deserialization (ERB + ActiveSupport)When combined with
Chain:
Verified on: Ruby 3.3.8 / RubyGems 3.6.7 / ActiveSupport 7.2.3 / ERB 6.0.1 ImpactScopeAny Ruby application that calls
Severity justificationThe This bypass renders the @_init mitigation ineffective across all ERB versions from 2.2.0 through 6.0.3 (latest as of April 2026). Combined with the DeprecatedInstanceVariableProxy gadget (present in all ActiveSupport versions through 7.2.3), this constitutes a universal RCE gadget chain for Ruby 3.2+ applications using Rails. Gadget chain historySix generations of Ruby Marshal gadget chains have been discovered (2018-2026). Each bypassed the previous round of mitigations: | Year | Chain | Mitigated in | |------|-------|-------------| | 2018 | Gem::Requirement (Luke Jahnke) | RubyGems 3.0 | | 2021 | UDG -- TarReader+WriteAdapter (vakzz) | RubyGems 3.1 | | 2022 | Gem::Specification._load (vakzz) | RubyGems 3.6 | | 2024 | UncaughtThrowError (Luke Jahnke) | Ruby 3.4 patches | | 2024 | Gem::Source::Git#rev_parse | RubyGems 3.6 | | 2026 | ERB#def_module @_init bypass | ERB 6.0.4 | PatchesThe problem has been patched at the following ERB versions. Please upgrade your erb.gem to any one of them.
Add the
Affected versions
2.2.0
2.2.1
2.2.2
2.2.3
3.0.0
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
5.0.0
5.0.1
+ 10 more Show less
5.0.2
5.0.3
5.1.0
5.1.1
5.1.2
5.1.3
6.0.0
6.0.1
6.0.2
6.0.3
Fixed in
4.0.3.1
4.0.4.1
6.0.1.1
6.0.4
References Updated Sep 10, 2026 · Source: OSV.dev | ||
2.2.3
patch
1 CVE
CVE-2026-41316
GHSA-q339-8rmv-2mhv
Apr 24, 2026
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
8.1
/ 10
High
Network
High
None
None
Unchanged
High
High
High
SummaryRuby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an
An attacker who can trigger The @_init GuardIn
In
When an ERB object is reconstructed via The Bypass
Method wrapper breakout
Proof of ConceptMinimal (ERB only)
Marshal deserialization (ERB + ActiveSupport)When combined with
Chain:
Verified on: Ruby 3.3.8 / RubyGems 3.6.7 / ActiveSupport 7.2.3 / ERB 6.0.1 ImpactScopeAny Ruby application that calls
Severity justificationThe This bypass renders the @_init mitigation ineffective across all ERB versions from 2.2.0 through 6.0.3 (latest as of April 2026). Combined with the DeprecatedInstanceVariableProxy gadget (present in all ActiveSupport versions through 7.2.3), this constitutes a universal RCE gadget chain for Ruby 3.2+ applications using Rails. Gadget chain historySix generations of Ruby Marshal gadget chains have been discovered (2018-2026). Each bypassed the previous round of mitigations: | Year | Chain | Mitigated in | |------|-------|-------------| | 2018 | Gem::Requirement (Luke Jahnke) | RubyGems 3.0 | | 2021 | UDG -- TarReader+WriteAdapter (vakzz) | RubyGems 3.1 | | 2022 | Gem::Specification._load (vakzz) | RubyGems 3.6 | | 2024 | UncaughtThrowError (Luke Jahnke) | Ruby 3.4 patches | | 2024 | Gem::Source::Git#rev_parse | RubyGems 3.6 | | 2026 | ERB#def_module @_init bypass | ERB 6.0.4 | PatchesThe problem has been patched at the following ERB versions. Please upgrade your erb.gem to any one of them.
Add the
Affected versions
2.2.0
2.2.1
2.2.2
2.2.3
3.0.0
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
5.0.0
5.0.1
+ 10 more Show less
5.0.2
5.0.3
5.1.0
5.1.1
5.1.2
5.1.3
6.0.0
6.0.1
6.0.2
6.0.3
Fixed in
4.0.3.1
4.0.4.1
6.0.1.1
6.0.4
References Updated Sep 10, 2026 · Source: OSV.dev | ||
2.2.1
patch
1 CVE
CVE-2026-41316
GHSA-q339-8rmv-2mhv
Apr 24, 2026
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
8.1
/ 10
High
Network
High
None
None
Unchanged
High
High
High
SummaryRuby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an
An attacker who can trigger The @_init GuardIn
In
When an ERB object is reconstructed via The Bypass
Method wrapper breakout
Proof of ConceptMinimal (ERB only)
Marshal deserialization (ERB + ActiveSupport)When combined with
Chain:
Verified on: Ruby 3.3.8 / RubyGems 3.6.7 / ActiveSupport 7.2.3 / ERB 6.0.1 ImpactScopeAny Ruby application that calls
Severity justificationThe This bypass renders the @_init mitigation ineffective across all ERB versions from 2.2.0 through 6.0.3 (latest as of April 2026). Combined with the DeprecatedInstanceVariableProxy gadget (present in all ActiveSupport versions through 7.2.3), this constitutes a universal RCE gadget chain for Ruby 3.2+ applications using Rails. Gadget chain historySix generations of Ruby Marshal gadget chains have been discovered (2018-2026). Each bypassed the previous round of mitigations: | Year | Chain | Mitigated in | |------|-------|-------------| | 2018 | Gem::Requirement (Luke Jahnke) | RubyGems 3.0 | | 2021 | UDG -- TarReader+WriteAdapter (vakzz) | RubyGems 3.1 | | 2022 | Gem::Specification._load (vakzz) | RubyGems 3.6 | | 2024 | UncaughtThrowError (Luke Jahnke) | Ruby 3.4 patches | | 2024 | Gem::Source::Git#rev_parse | RubyGems 3.6 | | 2026 | ERB#def_module @_init bypass | ERB 6.0.4 | PatchesThe problem has been patched at the following ERB versions. Please upgrade your erb.gem to any one of them.
Add the
Affected versions
2.2.0
2.2.1
2.2.2
2.2.3
3.0.0
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
5.0.0
5.0.1
+ 10 more Show less
5.0.2
5.0.3
5.1.0
5.1.1
5.1.2
5.1.3
6.0.0
6.0.1
6.0.2
6.0.3
Fixed in
4.0.3.1
4.0.4.1
6.0.1.1
6.0.4
References Updated Sep 10, 2026 · Source: OSV.dev | ||
2.2.2
patch
1 CVE
CVE-2026-41316
GHSA-q339-8rmv-2mhv
Apr 24, 2026
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
8.1
/ 10
High
Network
High
None
None
Unchanged
High
High
High
SummaryRuby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an
An attacker who can trigger The @_init GuardIn
In
When an ERB object is reconstructed via The Bypass
Method wrapper breakout
Proof of ConceptMinimal (ERB only)
Marshal deserialization (ERB + ActiveSupport)When combined with
Chain:
Verified on: Ruby 3.3.8 / RubyGems 3.6.7 / ActiveSupport 7.2.3 / ERB 6.0.1 ImpactScopeAny Ruby application that calls
Severity justificationThe This bypass renders the @_init mitigation ineffective across all ERB versions from 2.2.0 through 6.0.3 (latest as of April 2026). Combined with the DeprecatedInstanceVariableProxy gadget (present in all ActiveSupport versions through 7.2.3), this constitutes a universal RCE gadget chain for Ruby 3.2+ applications using Rails. Gadget chain historySix generations of Ruby Marshal gadget chains have been discovered (2018-2026). Each bypassed the previous round of mitigations: | Year | Chain | Mitigated in | |------|-------|-------------| | 2018 | Gem::Requirement (Luke Jahnke) | RubyGems 3.0 | | 2021 | UDG -- TarReader+WriteAdapter (vakzz) | RubyGems 3.1 | | 2022 | Gem::Specification._load (vakzz) | RubyGems 3.6 | | 2024 | UncaughtThrowError (Luke Jahnke) | Ruby 3.4 patches | | 2024 | Gem::Source::Git#rev_parse | RubyGems 3.6 | | 2026 | ERB#def_module @_init bypass | ERB 6.0.4 | PatchesThe problem has been patched at the following ERB versions. Please upgrade your erb.gem to any one of them.
Add the
Affected versions
2.2.0
2.2.1
2.2.2
2.2.3
3.0.0
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
5.0.0
5.0.1
+ 10 more Show less
5.0.2
5.0.3
5.1.0
5.1.1
5.1.2
5.1.3
6.0.0
6.0.1
6.0.2
6.0.3
Fixed in
4.0.3.1
4.0.4.1
6.0.1.1
6.0.4
References Updated Sep 10, 2026 · Source: OSV.dev | ||
2.2.0
initial
1 CVE
CVE-2026-41316
GHSA-q339-8rmv-2mhv
Apr 24, 2026
ERB has an @_init deserialization guard bypass via def_module / def_method / def_class
8.1
/ 10
High
Network
High
None
None
Unchanged
High
High
High
SummaryRuby 2.7.0 (before ERB 2.2.0 was published on rubygems.org) introduced an
An attacker who can trigger The @_init GuardIn
In
When an ERB object is reconstructed via The Bypass
Method wrapper breakout
Proof of ConceptMinimal (ERB only)
Marshal deserialization (ERB + ActiveSupport)When combined with
Chain:
Verified on: Ruby 3.3.8 / RubyGems 3.6.7 / ActiveSupport 7.2.3 / ERB 6.0.1 ImpactScopeAny Ruby application that calls
Severity justificationThe This bypass renders the @_init mitigation ineffective across all ERB versions from 2.2.0 through 6.0.3 (latest as of April 2026). Combined with the DeprecatedInstanceVariableProxy gadget (present in all ActiveSupport versions through 7.2.3), this constitutes a universal RCE gadget chain for Ruby 3.2+ applications using Rails. Gadget chain historySix generations of Ruby Marshal gadget chains have been discovered (2018-2026). Each bypassed the previous round of mitigations: | Year | Chain | Mitigated in | |------|-------|-------------| | 2018 | Gem::Requirement (Luke Jahnke) | RubyGems 3.0 | | 2021 | UDG -- TarReader+WriteAdapter (vakzz) | RubyGems 3.1 | | 2022 | Gem::Specification._load (vakzz) | RubyGems 3.6 | | 2024 | UncaughtThrowError (Luke Jahnke) | Ruby 3.4 patches | | 2024 | Gem::Source::Git#rev_parse | RubyGems 3.6 | | 2026 | ERB#def_module @_init bypass | ERB 6.0.4 | PatchesThe problem has been patched at the following ERB versions. Please upgrade your erb.gem to any one of them.
Add the
Affected versions
2.2.0
2.2.1
2.2.2
2.2.3
3.0.0
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
5.0.0
5.0.1
+ 10 more Show less
5.0.2
5.0.3
5.1.0
5.1.1
5.1.2
5.1.3
6.0.0
6.0.1
6.0.2
6.0.3
Fixed in
4.0.3.1
4.0.4.1
6.0.1.1
6.0.4
References Updated Sep 10, 2026 · Source: OSV.dev |