puppet 2.6.9 → 2.6.10

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puppet might be problematic. Click here for more details.

data/CHANGELOG CHANGED
@@ -1,3 +1,10 @@
1
+ 2.6.10
2
+ ===
3
+ ec5a32a Update spec and lib/puppet.rb for 2.6.10 release
4
+ fe2de81 Resist directory traversal attacks through indirections. (CVE-2011-3484)
5
+ 243aaa9 (#7956) Porting cron tests
6
+ 3e3fc69 (#7956) Port resource acceptance tests
7
+
1
8
  2.6.9
2
9
  ====
3
10
  db1a392 (#7506) Organize READMEs; specify supported Ruby versions in README.md
@@ -5,7 +5,7 @@
5
5
  %global confdir conf/redhat
6
6
 
7
7
  Name: puppet
8
- Version: 2.6.9
8
+ Version: 2.6.10
9
9
  Release: 1%{?dist}
10
10
  Summary: A network tool for managing many disparate systems
11
11
  License: GPLv2
@@ -253,6 +253,9 @@ fi
253
253
  rm -rf %{buildroot}
254
254
 
255
255
  %changelog
256
+ * Wed Sep 28 2011 Michael Stahnke <stahnma@puppetlabs.com> - 2.6.10-1
257
+ - Fix for CVE-2011-3484
258
+
256
259
  * Tue Jun 21 2011 Michael Stahnke <stahnma@puppetlabs.com> - 2.6.9-1
257
260
  - Release of 2.6.9
258
261
 
data/lib/puppet.rb CHANGED
@@ -24,7 +24,7 @@ require 'puppet/util/run_mode'
24
24
  # it's also a place to find top-level commands like 'debug'
25
25
 
26
26
  module Puppet
27
- PUPPETVERSION = '2.6.9'
27
+ PUPPETVERSION = '2.6.10'
28
28
 
29
29
  def Puppet.version
30
30
  PUPPETVERSION
@@ -68,4 +68,11 @@ module Puppet::Indirector
68
68
  self.class.indirection.save key, self
69
69
  end
70
70
  end
71
+
72
+
73
+ # Helper definition for indirections that handle filenames.
74
+ BadNameRegexp = Regexp.union(/^\.\./,
75
+ %r{[\\/]},
76
+ "\0",
77
+ /(?i)^[a-z]:/)
71
78
  end
@@ -52,8 +52,12 @@ class Puppet::Indirector::SslFile < Puppet::Indirector::Terminus
52
52
  (collection_directory || file_location) or raise Puppet::DevError, "No file or directory setting provided; terminus #{self.class.name} cannot function"
53
53
  end
54
54
 
55
- # Use a setting to determine our path.
56
55
  def path(name)
56
+ if name =~ Puppet::Indirector::BadNameRegexp then
57
+ Puppet.crit("directory traversal detected in #{self.class}: #{name.inspect}")
58
+ raise ArgumentError, "invalid key"
59
+ end
60
+
57
61
  if ca?(name) and ca_location
58
62
  ca_location
59
63
  elsif collection_directory
@@ -43,6 +43,11 @@ class Puppet::Indirector::Yaml < Puppet::Indirector::Terminus
43
43
 
44
44
  # Return the path to a given node's file.
45
45
  def path(name,ext='.yaml')
46
+ if name =~ Puppet::Indirector::BadNameRegexp then
47
+ Puppet.crit("directory traversal detected in #{self.class}: #{name.inspect}")
48
+ raise ArgumentError, "invalid key"
49
+ end
50
+
46
51
  base = Puppet.run_mode.master? ? Puppet[:yamldir] : Puppet[:clientyamldir]
47
52
  File.join(base, self.class.indirection_name.to_s, name.to_s + ext)
48
53
  end
@@ -87,6 +87,25 @@ describe Puppet::Indirector::SslFile do
87
87
  it "should set them in the setting directory, with the certificate name plus '.pem', if a directory setting is available" do
88
88
  @searcher.path(@cert.name).should == @certpath
89
89
  end
90
+
91
+ ['../foo', '..\\foo', './../foo', '.\\..\\foo',
92
+ '/foo', '//foo', '\\foo', '\\\\goo',
93
+ "test\0/../bar", "test\0\\..\\bar",
94
+ "..\\/bar", "/tmp/bar", "/tmp\\bar", "tmp\\bar",
95
+ " / bar", " /../ bar", " \\..\\ bar",
96
+ "c:\\foo", "c:/foo", "\\\\?\\UNC\\bar", "\\\\foo\\bar",
97
+ "\\\\?\\c:\\foo", "//?/UNC/bar", "//foo/bar",
98
+ "//?/c:/foo",
99
+ ].each do |input|
100
+ it "should resist directory traversal attacks (#{input.inspect})" do
101
+ expect { @searcher.path(input) }.to raise_error
102
+ end
103
+ end
104
+
105
+ # REVISIT: Should probably test MS-DOS reserved names here, too, since
106
+ # they would represent a vulnerability on a Win32 system, should we ever
107
+ # support that path. Don't forget that 'CON.foo' == 'CON'
108
+ # --daniel 2011-09-24
90
109
  end
91
110
 
92
111
  describe "when finding certificates on disk" do
@@ -63,6 +63,20 @@ describe Puppet::Indirector::Yaml, " when choosing file location" do
63
63
  it "should use the object's name to determine the file name" do
64
64
  @store.path(:me).should =~ %r{me.yaml$}
65
65
  end
66
+
67
+ ['../foo', '..\\foo', './../foo', '.\\..\\foo',
68
+ '/foo', '//foo', '\\foo', '\\\\goo',
69
+ "test\0/../bar", "test\0\\..\\bar",
70
+ "..\\/bar", "/tmp/bar", "/tmp\\bar", "tmp\\bar",
71
+ " / bar", " /../ bar", " \\..\\ bar",
72
+ "c:\\foo", "c:/foo", "\\\\?\\UNC\\bar", "\\\\foo\\bar",
73
+ "\\\\?\\c:\\foo", "//?/UNC/bar", "//foo/bar",
74
+ "//?/c:/foo",
75
+ ].each do |input|
76
+ it "should resist directory traversal attacks (#{input.inspect})" do
77
+ expect { @store.path(input) }.to raise_error
78
+ end
79
+ end
66
80
  end
67
81
 
68
82
  describe Puppet::Indirector::Yaml, " when storing objects as YAML" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 6
9
- - 9
10
- version: 2.6.9
9
+ - 10
10
+ version: 2.6.10
11
11
  platform: ruby
12
12
  authors:
13
13
  - Puppet Labs
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-06-21 00:00:00 -07:00
19
- default_executable:
18
+ date: 2011-09-28 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: facter
@@ -1392,7 +1391,6 @@ files:
1392
1391
  - bin/puppetmasterd
1393
1392
  - bin/puppetqd
1394
1393
  - bin/puppetrun
1395
- has_rdoc: true
1396
1394
  homepage: http://puppetlabs.com
1397
1395
  licenses: []
1398
1396
 
@@ -1426,7 +1424,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1426
1424
  requirements: []
1427
1425
 
1428
1426
  rubyforge_project: puppet
1429
- rubygems_version: 1.5.3
1427
+ rubygems_version: 1.8.10
1430
1428
  signing_key:
1431
1429
  specification_version: 3
1432
1430
  summary: Puppet, an automated configuration management tool