<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: [file PIPE] - how to secure? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/file-PIPE-how-to-secure/m-p/571971#M12258</link>
    <description>&lt;P&gt;Completely agreed with you on this &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's why I wanted to know if there is a way to secure it (without disabling it lol)&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jul 2019 08:21:26 GMT</pubDate>
    <dc:creator>k4minou</dc:creator>
    <dc:date>2019-07-09T08:21:26Z</dc:date>
    <item>
      <title>[file PIPE] - how to secure?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/file-PIPE-how-to-secure/m-p/571713#M12218</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am wondering if there is a way to secure the file piping?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* for example.. */
/* we scan the disk F with all its (sub)contents */
filename
	&amp;amp;fileDesc. pipe
	"@echo off &amp;amp; for /f ""delims="" %a in ('dir F: /s /b') do echo %~fa %~ta %~za"
	lrecl=32767;
%diskScan(&amp;amp;fileDesc., diskName = F);

/* now we have the full pathname to delete files, let's say a directory... */
filename
	&amp;amp;fileDesc. pipe
	"@echo off &amp;amp; rd F:\someDir2Remove /S /Q"
	lrecl=32767;
%diskScan(&amp;amp;fileDesc., diskName = F);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the macro %diskScan is a simple macro reading the &amp;amp;fileDesc. with few regex&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, we can inject in the pipe some command that could be a serious problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moreover, the other point is after the full scan, we can see the file that we are not supposed to see&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, is there a way to secure it (without disabling the pipe) ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for your reply/help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 08:09:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/file-PIPE-how-to-secure/m-p/571713#M12218</guid>
      <dc:creator>k4minou</dc:creator>
      <dc:date>2019-07-09T08:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: [file PIPE] - how to secure?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/file-PIPE-how-to-secure/m-p/571730#M12219</link>
      <description>&lt;P&gt;If the user has the file-system-rights to delete the file, securing pipe would be of no use, because he/she could just use the fdelete function.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 11:05:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/file-PIPE-how-to-secure/m-p/571730#M12219</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-07-08T11:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: [file PIPE] - how to secure?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/file-PIPE-how-to-secure/m-p/571734#M12220</link>
      <description>&lt;P&gt;file pipe can be disabled entirely using the -noxcmd start up option, in facts, that's the default in most configurations. It's a difficult topic, XCMDs bring very significant and powerful capabilities, but Spiderman allies (great power, great responsibilities).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can basically do whatever your user account is allowed to do, and if that means file deleting, you can.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, it throws a focus on to the SAS environment being properly configured and setup, that end users DO NOT have permissions to write and delete inside the SAS configuration directory, etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps the greatest risk is that mistakes can happen, a bit of code to "delete files"&amp;nbsp; is fine when you use it as intended on "your" files, but the day you pass it a blank "directory" value, it ends up working on a directory you didn't intend, and merrily deletes everyone else's files.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 11:25:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/file-PIPE-how-to-secure/m-p/571734#M12220</guid>
      <dc:creator>AngusLooney</dc:creator>
      <dc:date>2019-07-08T11:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: [file PIPE] - how to secure?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/file-PIPE-how-to-secure/m-p/571749#M12221</link>
      <description>&lt;P&gt;If you do not want that users have access to certain files, you need to properly set permissions on the operating system level. As long as users have a system account, they can use that outside of SAS to wreck your day (if you are the system admin, and were sloppy).&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 11:56:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/file-PIPE-how-to-secure/m-p/571749#M12221</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-07-08T11:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: [file PIPE] - how to secure?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/file-PIPE-how-to-secure/m-p/571968#M12256</link>
      <description>&lt;P&gt;Thank you all for your kind replies &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was not clear sorry ; I am only a regular user, I am not an administrator and have thus no actions on the server in terms of settings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The current environnement :&lt;/P&gt;&lt;P&gt;• OS = WIN (X64_SRV12)&lt;BR /&gt;• SAS = 9.04.01M3P062415&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Via Windows Explorer (even via dos command), the differents properties level are good - I can only access, read or write the files/directories that I am supposed to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Same for SAS Guide Explorer, the partitioning of the differents files are good, I can only see/manipulate what I am supposed to see/manipulate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the problem occurs with the piping... I can read full path filename then with a CP command, I can grab everything I want, I can even delete and all of this via piping command injection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to report this problem to the administrators, but before to do it, I am here to know if there is any way to secure without disabling the piping (because I need the piping...)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why I need it ? Because I want to dynamically mount a network disk that is not mounted by default, to work on it (maybe there is a specific function/command on SAS?)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do it with these instructions&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename
	&amp;amp;fileDesc. pipe
	"@echo off &amp;amp; NET USE T: /DELETE /Y &amp;amp; NET USE T: \\XXXX\ZZZ"
	lrecl=32767;
%diskScan(&amp;amp;fileDesc., diskName = T);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank you again in any case ^^&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;o(&amp;nbsp; ^&amp;nbsp; &amp;nbsp;^&amp;nbsp; )o Cheers!!! o(&amp;nbsp; ^&amp;nbsp; &amp;nbsp;^&amp;nbsp; )o&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 08:08:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/file-PIPE-how-to-secure/m-p/571968#M12256</guid>
      <dc:creator>k4minou</dc:creator>
      <dc:date>2019-07-09T08:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: [file PIPE] - how to secure?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/file-PIPE-how-to-secure/m-p/571970#M12257</link>
      <description>&lt;P&gt;The fdelete is only usefull if we know the full path, by default everything is partitionned here and each group of user can see the files they are supposed to see.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I can see C:\Dir\File2Delete.txt then ofc I dont need to use weird way to delete it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The main problem here is thanks to the piping, I can see the files I am not supposed to see, it also means that I know the full path name which can become the arg for my deletion (with fdelete or not) &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 08:17:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/file-PIPE-how-to-secure/m-p/571970#M12257</guid>
      <dc:creator>k4minou</dc:creator>
      <dc:date>2019-07-09T08:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: [file PIPE] - how to secure?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/file-PIPE-how-to-secure/m-p/571971#M12258</link>
      <description>&lt;P&gt;Completely agreed with you on this &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's why I wanted to know if there is a way to secure it (without disabling it lol)&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 08:21:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/file-PIPE-how-to-secure/m-p/571971#M12258</guid>
      <dc:creator>k4minou</dc:creator>
      <dc:date>2019-07-09T08:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: [file PIPE] - how to secure?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/file-PIPE-how-to-secure/m-p/571978#M12259</link>
      <description>&lt;P&gt;With Windows, you can usually just use the UNC, no need to mount it in order to be able to access it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, you can use&amp;nbsp; "\\xxxx\zzz\thefile.txt" as the path to the file, in an import for instance.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 08:48:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/file-PIPE-how-to-secure/m-p/571978#M12259</guid>
      <dc:creator>AngusLooney</dc:creator>
      <dc:date>2019-07-09T08:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: [file PIPE] - how to secure?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/file-PIPE-how-to-secure/m-p/571982#M12261</link>
      <description>&lt;P&gt;Thank you, but...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I got some “unc path not supported” as errors, I gave up and finaly used the simplest and also fastest way; to mount a virtual network disk which is only existed during the session SAS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But yes, I firstly tried with UNC directly &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 09:15:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/file-PIPE-how-to-secure/m-p/571982#M12261</guid>
      <dc:creator>k4minou</dc:creator>
      <dc:date>2019-07-09T09:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: [file PIPE] - how to secure?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/file-PIPE-how-to-secure/m-p/571984#M12262</link>
      <description>&lt;P&gt;Well, if it won't work implicitly, you've got no choice. Odd though.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 09:20:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/file-PIPE-how-to-secure/m-p/571984#M12262</guid>
      <dc:creator>AngusLooney</dc:creator>
      <dc:date>2019-07-09T09:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: [file PIPE] - how to secure?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/file-PIPE-how-to-secure/m-p/571986#M12264</link>
      <description>&lt;P&gt;lol yes, if the server works well it will be easier for the rest of the world ^^&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 09:56:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/file-PIPE-how-to-secure/m-p/571986#M12264</guid>
      <dc:creator>k4minou</dc:creator>
      <dc:date>2019-07-09T09:56:29Z</dc:date>
    </item>
  </channel>
</rss>

