Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Critical
-
Resolution: Unresolved
-
Affects Version/s: 0.10.4
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
I first filled CHEF-2747 but in the it might be very related.
there must be a missing test before doing the checksum of a file. i don't think the file is being tested as a symlink.
(haven't looked at the source yet tho)
anyway, here is the test, i first considered reporting this in private, in the end i'm not sure it's such a huge security issue.
cookbook_file "/tmp/BLA" do source "BLA" owner "root" group "www-data" mode "0770" end
$ md5sum cookbooks/test1/files/default/BLA bac01d02e1d80e86fa2ae0d053f8d903 cookbooks/test1/files/default/BLA
on the node, before chef-client run:
$ ls -l /tmp/BLA /tmp/TEST lrwxrwxrwx 1 root root 4 2011-11-24 00:25 BLA -> TEST -r--r--r-- 1 laurent laurent 4 2011-11-24 00:26 TEST $ md5sum /tmp/BLA bac01d02e1d80e86fa2ae0d053f8d903 /tmp/BLA
after chef-client run:
ls -l /tmp/BLA /tmp/TEST lrwxrwxrwx 1 root root 4 2011-11-24 00:25 BLA -> TEST -rwxrwx--- 1 root www-data 4 2011-11-24 00:26 TEST
BLA is unchanged, TEST's mode, owner and group are changed. oh oh looks like a symlink traversal issue ! ![]()
def new_resource_content_checksum @new_resource.content && Digest::SHA2.hexdigest(@new_resource.content) endI knew it wasn't md5sum, any known vuln with sha256 ?