Issue #10908 has been updated by James Turnbull.

Assignee changed from Dan Lowe to Daniel Pittman

It should be - assigned to the PL person who closed it as last actioner.
----------------------------------------
Bug #10908: puppet executing files in local directory, ignoring configured path 
when running OnlyIf/Unless
https://projects.puppetlabs.com/issues/10908

Author: Jo Rhett
Status: Rejected
Priority: Urgent
Assignee: Daniel Pittman
Category: exec
Target version: 
Affected Puppet version: 2.6.12
Keywords: 
Branch: 


For reasons unclear to me, OnlyIf and Unless are checking file permissions in 
the current directory when running puppet agent or puppet apply, even though

1. Current directory is not in the user's path
2. Current directory is not in the configured path

This causes puppet manifests to fail based on files in the local directory.

<pre>
 $ vim insecure.pp
 exec { test:
   path      => '/bin:/usr/bin',
   command   => 'echo secure',
   onlyif    => 'test -d /tmp',
   logoutput => true,
 }
 $ touch test
 $ chmod 444 test
 $ puppet apply insecure.pp 
 err: /Stage[main]//Exec[test]: Could not evaluate: 'test' is not executable
 notice: Finished catalog run in 0.08 seconds
</pre>

Oddly enough, it doesn't seem to execute it -- just checks the permissions.

<pre>
$ chmod 755 test
$ puppet apply insecure.pp 
notice: /Stage[main]//Exec[test]/returns: secure
notice: /Stage[main]//Exec[test]/returns: executed successfully
notice: Finished catalog run in 0.17 seconds
</pre>

This is at least a random failure case based on files in the puppet agent's 
current directory, but I'm sure this is an exploitable security bug somehow.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to