VYPR
Moderate severityNVD Advisory· Published May 27, 2014· Updated May 6, 2026

CVE-2014-0177

CVE-2014-0177

Description

The am function in lib/hub/commands.rb in hub before 1.12.1 allows local users to overwrite arbitrary files via a symlink attack on a temporary patch file.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
github.com/github/hubGo
< 1.12.11.12.1
hubRubyGems
< 1.12.11.12.1

Affected products

1
  • cpe:2.3:a:github:hub:*:*:*:*:*:*:*:*
    Range: <=1.12.0

Patches

2
016ec99d25b1

Use non-predictable filename for downloaded patch file

https://github.com/mislav/hubMichael SchererApr 13, 2014via ghsa
2 files changed · +1 5
  • lib/hub/commands.rb+1 1 modified
    @@ -519,7 +519,7 @@ def am(args)
               end
             end
     
    -        patch_file = File.join(tmp_dir, patch_name)
    +        patch_file = Tempfile.new('patch_name')
             File.open(patch_file, 'w') { |file| file.write(patch) }
             args[idx] = patch_file
           end
    
  • lib/hub/context.rb+0 4 modified
    @@ -556,10 +556,6 @@ def command?(name)
             !which(name).nil?
           end
     
    -      def tmp_dir
    -        ENV['TMPDIR'] || ENV['TEMP'] || '/tmp'
    -      end
    -
           def terminal_width
             if unix?
               width = %x{stty size 2>#{NULL}}.split[1].to_i
    
016ec99d25b1

Use non-predictable filename for downloaded patch file

https://github.com/github/hubMichael SchererApr 13, 2014via ghsa
2 files changed · +1 5
  • lib/hub/commands.rb+1 1 modified
    @@ -519,7 +519,7 @@ def am(args)
               end
             end
     
    -        patch_file = File.join(tmp_dir, patch_name)
    +        patch_file = Tempfile.new('patch_name')
             File.open(patch_file, 'w') { |file| file.write(patch) }
             args[idx] = patch_file
           end
    
  • lib/hub/context.rb+0 4 modified
    @@ -556,10 +556,6 @@ def command?(name)
             !which(name).nil?
           end
     
    -      def tmp_dir
    -        ENV['TMPDIR'] || ENV['TEMP'] || '/tmp'
    -      end
    -
           def terminal_width
             if unix?
               width = %x{stty size 2>#{NULL}}.split[1].to_i
    

Vulnerability 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

7

News mentions

0

No linked articles in our index yet.