Repository navigation
Update dependency bundler to v4 [SECURITY] - #13
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
"~> 1.5"→"~> 4.0"Local Code Execution through Argument Injection via dash leading git url parameter in Gemfile.
CVE-2021-43809 / GHSA-fj7f-vq84-fh43
More information
Details
In
bundlerversions before 2.2.33, when working with untrusted and apparently harmlessGemfile's, it is not expected that they lead to execution of external code, unless that's explicit in the ruby code inside theGemfileitself. However, if theGemfileincludesgementries that use thegitoption with invalid, but seemingly harmless, values with a leading dash, this can be false.To handle dependencies that come from a Git repository instead of a registry, Bundler uses various commands, such as
git clone. These commands are being constructed using user input (e.g. the repository URL). When building thecommands, Bundler versions before 2.2.33 correctly avoid Command Injection vulnerabilities by passing an array of arguments instead of a command string. However, there is the possibility that a user input starts with a dash (
-) and is therefore treated as an optional argument instead of a positional one. This can lead to Code Execution because some of the commands have options that can be leveraged to run arbitrary executables.Since this value comes from the
Gemfilefile, it can contain any character, including a leading dash.Exploitation
To exploit this vulnerability, an attacker has to craft a directory containing a
Gemfilefile that declares a dependency that is located in a Git repository. This dependency has to have a Git URL in the form of-u./payload. This URLwill be used to construct a Git clone command but will be interpreted as the upload-pack argument. Then this directory needs to be shared with the victim, who then needs to run a command that evaluates the Gemfile, such as
bundle lock, inside.Impact
This vulnerability can lead to Arbitrary Code Execution, which could potentially lead to the takeover of the system. However, as explained above, the exploitability is very low, because it requires a lot of user interaction. It still could put developers at risk when dealing with untrusted files in a way they think is safe, because the exploit still works when the victim tries to make sure nothing can happen, e.g. by manually reviewing the
Gemfile(although they would need the weird URL with a leading dash to not raise any flags).This kind of attack vector has been used in the past to target security researchers by sending them projects to collaborate on.
Patches
Bundler 2.2.33 has patched this problem by inserting
--as an argument before any positional arguments to those Git commands that were affected by this issue.Workarounds
Regardless of whether users can upgrade or not, they should review any untrustred
Gemfile's before running anybundlercommands that may read them, since they can contain arbitrary ruby code.References
https://cwe.mitre.org/data/definitions/88.html
Severity
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Bundler allows attacker to inject arbitrary code via secondary Gem source
CVE-2016-7954 / GHSA-jvgm-pfqv-887x
More information
Details
Bundler 1.x might allow remote attackers to inject arbitrary Ruby code into an application by leveraging a gem name collision on a secondary source. NOTE: this might overlap CVE-2013-0334.
Severity
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
ruby/rubygems (bundler)
v4.1.0Compare Source
RubyGems
Changes already released in 4.0.x are not repeated here.
Features:
Gem::PackageTask. Pull request #9897 by Harriet Oughton, Gira Chawda and Jenny Shen--content-addressabletogem buildand make--ruby-abionly set the Ruby ABI. Pull request #9906 by Harriet Oughton--no-build-extensionand--no-install-pluginoptions to gem install. Pull request #9473 by Hiroshi SHIBATAPerformance:
verify_gz. Pull request #9093 by EileenEnhancements:
Breaking changes:
gem build --platformfor the local platform. Pull request #9873 by Hiroshi SHIBATAgem update --user-installupdating gems outside the user directory. Pull request #9872 by Hiroshi SHIBATADEFAULT_INSTALL_EXTENSION_IN_LIBand warnrequire_relativewith C ext. Pull request #9390 by Hiroshi SHIBATAGem::List. Pull request #9161 by Hiroshi SHIBATABundler
Changes already released in 4.0.x are not repeated here.
Features:
from:andto:keys ofoverridetoin:andwith:. Pull request #9979 by Hiroshi SHIBATAOVERRIDESsection). Pull request #9958 by Ufuk Kayserilioglusparse_checkoutoption to git source. Pull request #9295 by Ian Ker-Seymer and Hiroshi SHIBATA--exact-matchFlag forbundle info/show/open. Pull request #9489 by Harriet Oughtonprunesetting to drop rebuildable install artifacts. Pull request #9815 by Hiroshi SHIBATAoverrideDSL with:alltarget and metadata fields (Phase 2). Pull request #9530 by Hiroshi SHIBATAoverrideDSL for version constraints (Phase 1). Pull request #9517 by Hiroshi SHIBATA--no-build-extensionand--no-install-pluginoptions to gem install. Pull request #9473 by Hiroshi SHIBATAPerformance:
Enhancements:
Bug fixes:
fallback_timeout. Pull request #10046 by Hiroshi SHIBATABreaking changes:
bundle env. Pull request #9593 by Hiroshi SHIBATADeprecations:
v4.0.24Compare Source
RubyGems
Enhancements:
Bug fixes:
Documentation:
Bundler
Enhancements:
Bug fixes:
bundle execwith no arguments for paths containing spaces. Pull request #9996 by Brandon WeissBundler::Source::Rubygems#hashagree witheql?. Pull request #9983 by Hiroshi SHIBATAbundle lock. Pull request #9960 by Farid Zakariav4.0.23Compare Source
RubyGems
Enhancements:
Bundler
Enhancements:
Bug fixes:
bundle lock. Pull request #9661 by David Stosik and Hiroshi SHIBATAv4.0.22Compare Source
RubyGems
Enhancements:
Bug fixes:
Bundler
Enhancements:
bundle platform. Pull request #9898 by Islam ElsayedBug fixes:
Bundler.bin_pathcreating the directory it reports. Pull request #9887 by Islam Elsayed and Hiroshi SHIBATAbundler-<command>executables only in PATH. Pull request #9874 by Hiroshi SHIBATADocumentation:
--majoras preferring the latest major version. Pull request #9891 by Hiroshi SHIBATAv4.0.21Compare Source
RubyGems
Enhancements:
Bundler
Enhancements:
Bug fixes:
safe.bareRepository=explicitin git sources. Pull request #9876 by Hiroshi SHIBATAv4.0.20Compare Source
RubyGems
Enhancements:
gem update --system. Pull request #9794 by hsbtBug fixes:
Documentation:
Bundler
Enhancements:
Bug fixes:
bundle init --gemspecgets no specification. Pull request #9818 by hsbtDocumentation:
v4.0.19Compare Source
RubyGems
Enhancements:
Bug fixes:
Documentation:
Bundler
Enhancements:
Bug fixes:
Documentation:
v4.0.18Compare Source
RubyGems
Enhancements:
Bug fixes:
Documentation:
Bundler
Enhancements:
Bug fixes:
bundle checkwhen frozen mode needs lockfile changes. Pull request #9715 by hsbtSecurity:
Documentation:
v4.0.17Compare Source
RubyGems
Enhancements:
Bug fixes:
bundlebinstub broken bygem update --systemon Homebrew ruby. Pull request #9688 by hsbtBundler
Enhancements:
Bug fixes:
Documentation:
v4.0.16Compare Source
RubyGems
Enhancements:
Bug fixes:
Bundler
Enhancements:
Bug fixes:
Documentation:
v4.0.15Compare Source
RubyGems
Enhancements:
Bug fixes:
Bundler
Enhancements:
Bug fixes:
Bundler.settings[:ssl_ca_cert]to download gems. Pull request #9610 by junarugav4.0.14Compare Source
RubyGems
Enhancements:
Bundler
Bug fixes:
v4.0.13Compare Source
RubyGems
Enhancements:
Bundler
Enhancements:
Bug fixes:
Security:
cooldownto delay newly published gem. Pull request #9576 by hsbtv4.0.12Compare Source
RubyGems
Enhancements:
Bug fixes:
BUNDLE_VERSIONis "lockfile". Pull request #9545 by hsbtBUNDLE_VERSIONenv var inBundlerVersionFinder. Pull request #9538 by hsbtBundler
Enhancements:
bundle config getreturn status 1 when the value is not set. Pull request #9505 by willnetBundler.setup. Pull request #4892 by godfatBug fixes:
v4.0.11Compare Source
RubyGems
Enhancements:
gem spec. Pull request #9476 by eregonBundler
Enhancements:
Bug fixes:
Documentation:
v4.0.10Compare Source
RubyGems
Enhancements:
Bug fixes:
Bundler
Enhancements:
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.