Fix CVE-2026-41316: upgrade erb gem to 4.0.3.1 in ama-logs Linux image#1692
Merged
zanejohnson-azure merged 2 commits intoMay 19, 2026
Merged
Conversation
The erb default gem shipped with Ruby 3.3 is 4.0.3, which is flagged by trivy for CVE-2026-41316. Upstream Ruby has not been re-released with the fix, but a backport (erb 4.0.3.1) is published to rubygems.org. Follow the same pattern used for the zlib CVE fix: install the patched gem, then delete the default gemspec so the vulnerable version is no longer detected. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
suyadav1
approved these changes
May 19, 2026
Contributor
|
Do we know if erb gem is used in ama-logs? |
Contributor
Author
|
also, erb is default and core gem (a part of stdlib of ruby, and erb can't be removed using gem uninstall command since it is a part of stdlib), thus, removing it could cause ruby failure at runtime. fluentd load it at runtime. w/o this gem, fluentd may fail to start. out of curiosity, i removed erb and will do some test. but no matter what the result is, i suggest we should not remove it considering erb is in stdlib of ruby. update: A Ruby LoadError raised when fluentd's startup tried to require 'erb'. The chain:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Mitigates CVE-2026-41316 in the
erbRuby default gem (HIGH) flagged by trivy on the ama-logs 3.4.0 candidate image.Installs the patched
erb 4.0.3.1from rubygems and removes the vulnerable defaulterb-4.0.3gemspec shipped withruby 3.3.10, following the same pattern already used forzlib(CVE-2026-27820) directly above.Why install-and-delete instead of just upgrading ruby?
No released Ruby version yet ships erb 4.0.3.1.
ruby_3_3branch HEAD (unreleased)ruby_3_4branch HEAD (unreleased)masterThe patched erb only lives in (1) the rubygems.org gem and (2) unreleased ruby maintenance branches. Until ruby 3.3.12 / 3.4.7 ships and AzureLinux picks it up, installing the gem and shadowing the default gemspec is the only available fix.
Verification
erb 4.0.3.1exists on rubygems (published 2026-04-21, sha871b7da4...).ciprod:3.3.0shipsruby 3.3.10witherb-4.0.3.gemspecin the default specs dir.Follow-up
Added an inline comment in
setup.shnoting that whenever ruby is upgraded next, the maintainer should check the bundled erb version and drop this block if it's already 4.0.3.1+.