<div dir="ltr">All of FS gives you unrestricted access -- raw XML, mod_xml_curl, lua, etc.<div><br><div>If you want to limit access, use <a href="http://wiki.freeswitch.org/wiki/Mod_httapi">http://wiki.freeswitch.org/wiki/Mod_httapi</a> -- it has a permissions option for what the user is allowed to access. </div>

<div>THAT system has a permission framework. If you find a bug in there, then there&#39;s something to do about it.<br clear="all"><div><div dir="ltr"><span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small">-Avi</span></div>

</div><br><div class="gmail_quote">On Sun, May 19, 2013 at 11:26 PM, Nathan Neulinger <span dir="ltr">&lt;<a href="mailto:nneul@mst.edu" target="_blank">nneul@mst.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Agreed. I was actually (in my case) less concerned about security than &#39;oops that didn&#39;t do the right thing&#39; for stuff<br>
as simple as &quot;user email address(es)&quot; - accidentally using a &quot;;&quot; to separate them (users coming from outlook for<br>
example) would result in a completely improper behavior - trying to run user address as a command...<br>
<br>
Similar for something like &quot;send this caller-id name to this external system command&quot; - too many places where a<br>
seemingly legitimate use is really insecure.<br>
<br>
I submitted a Jira with a patch to at least add a shell quoting function, and another one to make use of that shell<br>
quoting for the email addr in switch_simple_email. I&#39;m sure there are others, but I wanted to cover a couple obvious cases.<br>
<br>
Would need more work to be fully useful though...<br>
<br>
-- Nathan<br>
<div class="im"><br>
On 05/19/2013 02:50 PM, Cal Leeming [Simplicity Media Ltd] wrote:<br>
&gt; This could really use some input from Tony, as it really comes down to a design decision.<br>
&gt;<br>
&gt; It could be argued that you should not be exposing raw configuration to your customers without sanitizing the input<br>
&gt; yourselves.. and it could be argued that the input should be sanitized anyway.<br>
&gt;<br>
&gt; FS isn&#39;t attempting to push security through obscurity (given that all the code is open source), but many closed source<br>
&gt; products do.<br>
&gt;<br>
&gt; Either way, it would be good to hear Tony&#39;s thoughts on this.<br>
&gt;<br>
&gt; Cal<br>
&gt;<br>
</div><div class="im">&gt; On Sun, May 19, 2013 at 8:21 PM, Daniel Ivanov &lt;<a href="mailto:sertys@gmail.com">sertys@gmail.com</a> &lt;mailto:<a href="mailto:sertys@gmail.com">sertys@gmail.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     I am glad to see someone is concerned about input validation when it comes to voip. It is much neglected when we&#39;re<br>
&gt;     constructing our services, partly due to the fact that it&#39;s still considered black magic. I believe that system and<br>
&gt;     bgsystem should be strictly regulated and  ani and sip vars should be safe-parsed before feeding to a turing<br>
&gt;     machine. Security through obscurity has never worked and i beth my both legs we all have a few vulnerable<br>
&gt;     applications behind our backs. Let&#39;s unite to make FS the most stable and secure softswitch out there.<br>
&gt;<br>
</div><div><div class="h5">&gt;     On May 19, 2013 5:21 PM, &quot;Nathan Neulinger&quot; &lt;<a href="mailto:nneul@mst.edu">nneul@mst.edu</a> &lt;mailto:<a href="mailto:nneul@mst.edu">nneul@mst.edu</a>&gt;&gt; wrote:<br>


&gt;<br>
&gt;         I&#39;ve noticed several places in FS code and examples where it isn&#39;t safe at all to take user supplied data.<br>
&gt;<br>
&gt;         An easy example is the use of mailer_app:<br>
&gt;<br>
&gt;<br>
&gt;         #ifdef WIN32<br>
&gt;               switch_snprintf(buf, B64BUFFLEN, &quot;\&quot;\&quot;%s\&quot; -f %s %s %s &lt; \&quot;%s\&quot;\&quot;&quot;, runtime.mailer_app, from,<br>
&gt;         runtime.mailer_app_args, to, filename);<br>
&gt;         #else<br>
&gt;               switch_snprintf(buf, B64BUFFLEN, &quot;/bin/cat %s | %s -f %s %s %s&quot;, filename, runtime.mailer_app, from,<br>
&gt;         runtime.mailer_app_args, to);<br>
&gt;         #endif<br>
&gt;<br>
&gt;         another is ANY use of passing channel vars or data to a system or bgsystem command.<br>
&gt;<br>
&gt;<br>
&gt;         This isn&#39;t an issue normally, but if you want to give limited ability for users to control their own dial rules,<br>
&gt;         then<br>
&gt;         you wind up having to be very careful with processing the data to make sure it&#39;s safe. That&#39;s always a good<br>
&gt;         idea, but it<br>
&gt;         still seems like a bad idea to take that data and then directly use it in a completely unsafe context like a parsed<br>
&gt;         command line.<br>
&gt;<br>
&gt;         For the voicemail notify case, seems like an easy answer would be something like a &quot;vm-notify-hook&quot;, which at that<br>
&gt;         point, could call out to lua or perl to do the actual sending in a safe manner, passing the recipient/sender/etc. as<br>
&gt;         data instead of on cmd line.<br>
&gt;<br>
&gt;         For the &#39;passing channel vars...&#39; case, I think it would be good to have a &#39;system_json&#39; and &#39;bgsystem_json&#39; set of<br>
&gt;         routines that would pass channel data to the script on stdin in json format.<br>
&gt;<br>
&gt;         Regardless of implementation of either of those, I think it would be worthwhile to have a shell_escape() routine<br>
&gt;         in the<br>
&gt;         core utilities to allow the current syntax to be used more safely.<br>
&gt;<br>
&gt;         -- Nathan<br>
&gt;<br>
&gt;         ------------------------------------------------------------<br>
</div></div>&gt;         Nathan Neulinger <a href="mailto:nneul@mst.edu">nneul@mst.edu</a> &lt;mailto:<a href="mailto:nneul@mst.edu">nneul@mst.edu</a>&gt;<br>
&gt;         Missouri S&amp;T Information Technology <a href="tel:%28573%29%20612-1412" value="+15736121412">(573) 612-1412</a> &lt;tel:%28573%29%20612-1412&gt;<br>
<div class="im">&gt;         System Administrator - Architect<br>
&gt;<br>
&gt;         _________________________________________________________________________<br>
&gt;         Professional FreeSWITCH Consulting Services:<br>
</div>&gt;         <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a> &lt;mailto:<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>&gt;<br>
<div class="im">&gt;         <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
&gt;<br>
&gt;         FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
&gt;         <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
&gt;<br>
&gt;         Official FreeSWITCH Sites<br>
&gt;         <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;         <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
&gt;         <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
&gt;<br>
&gt;         FreeSWITCH-users mailing list<br>
</div>&gt;         <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a> &lt;mailto:<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>&gt;<br>


<div class="im">&gt;         <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
&gt;         UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
&gt;         <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;<br>
&gt;<br>
&gt;     _________________________________________________________________________<br>
&gt;     Professional FreeSWITCH Consulting Services:<br>
</div>&gt;     <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a> &lt;mailto:<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>&gt;<br>
<div class="im">&gt;     <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
&gt;<br>
&gt;     FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
&gt;     <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
&gt;<br>
&gt;     Official FreeSWITCH Sites<br>
&gt;     <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;     <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
&gt;     <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
&gt;<br>
&gt;     FreeSWITCH-users mailing list<br>
</div>&gt;     <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a> &lt;mailto:<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>&gt;<br>


<div class="im">&gt;     <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
&gt;     UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
&gt;     <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;<br>
&gt;<br>
<br>
</div>--<br>
<div class="HOEnZb"><div class="h5">------------------------------------------------------------<br>
Nathan Neulinger                       <a href="mailto:nneul@mst.edu">nneul@mst.edu</a><br>
Missouri S&amp;T Information Technology    <a href="tel:%28573%29%20612-1412" value="+15736121412">(573) 612-1412</a><br>
System Administrator - Architect<br>
<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</div></div></blockquote></div><br></div></div></div>