Low severity2.8OSV Advisory· Published Jul 20, 2025· Updated Apr 15, 2026
CVE-2025-54314
CVE-2025-54314
Description
Thor before 1.4.0 can construct an unsafe shell command from library input. NOTE: this is disputed by the Supplier because "the method that was fixed can only be used with arguments that are controlled by Thor, and there is no way an attacker can take control of those arguments."
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
thorRubyGems | < 1.4.0 | 1.4.0 |
Affected products
1Patches
2536b79036a0eMerge pull request #897 from odaysec/patch-1
3 files changed · +4 −4
lib/thor/shell/basic.rb+1 −1 modified@@ -372,7 +372,7 @@ def merge(destination, content) #:nodoc: Tempfile.open([File.basename(destination), File.extname(destination)], File.dirname(destination)) do |temp| temp.write content temp.rewind - system %(#{merge_tool} "#{temp.path}" "#{destination}") + system(merge_tool, temp.path, destination) end end
spec/actions/create_file_spec.rb+1 −1 modified@@ -142,7 +142,7 @@ def silence! create_file("doc/config.rb") allow(@base.shell).to receive(:merge_tool).and_return("meld") expect(Thor::LineEditor).to receive(:readline).and_return("m") - expect(@base.shell).to receive(:system).with(/meld/) + expect(@base.shell).to receive(:system).with("meld", /doc\/config\.rb/, /doc\/config\.rb/) invoke! end end
spec/shell/basic_spec.rb+2 −2 modified@@ -553,14 +553,14 @@ def #456 Lanç... it "invokes the merge tool" do allow(shell).to receive(:merge_tool).and_return("meld") expect(Thor::LineEditor).to receive(:readline).and_return("m") - expect(shell).to receive(:system).with(/meld/) + expect(shell).to receive(:system).with("meld", /foo/, "foo") capture(:stdout) { shell.file_collision("foo") {} } end it "invokes the merge tool that specified at ENV['THOR_MERGE']" do allow(ENV).to receive(:[]).with("THOR_MERGE").and_return("meld") expect(Thor::LineEditor).to receive(:readline).and_return("m") - expect(shell).to receive(:system).with(/meld/) + expect(shell).to receive(:system).with("meld", /foo/, "foo") capture(:stdout) { shell.file_collision("foo") {} } end
518ae0f49bb1Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
8- github.com/advisories/GHSA-mqcp-p2hv-vw6xghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-54314ghsaADVISORY
- github.com/github/advisory-database/pull/5912nvdWEB
- github.com/rails/thor/commit/536b79036a0efb765c1899233412e7b1ca94abfanvdWEB
- github.com/rails/thor/pull/897nvdWEB
- github.com/rails/thor/releases/tag/v1.4.0nvdWEB
- github.com/rubysec/ruby-advisory-db/blob/master/gems/thor/CVE-2025-54314.ymlghsaWEB
- hackerone.com/reports/3260153nvdWEB
News mentions
0No linked articles in our index yet.