<p>Reported by: Helmut Grohne <a href="mailto:helmut@subdivi.de">helmut@subdivi.de</a></p>

<p>The kamailio package now installs /etc/kamailio/kamailio-basic.cfg which<br>
can be selected via the CFGFILE= setting in /etc/default/kamailio. The<br>
configuration contains:</p>

<pre><code>modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
</code></pre>

<p>This setting is insecure and may allow local users to elevate privileges<br>
to the kamailio user.</p>

<p>The issue extends to kamailio-advanced.cfg. It seems that this is due to<br>
an incomplete fix of #712083. Looking further, the state of /tmp file<br>
vulnerabilities in kamailio looks worrisome. Most of the results of the<br>
following command (to be executed in the kamailio source) are likely<br>
vulnerable if executed:</p>

<pre><code>grep '/tmp/[a-z0-9_.-]\+\(\$\$\)\?\([" ]\|$\)' -r .
</code></pre>

<p>Granted, some of the results are examples, documentation or obsolete.<br>
But quite a few reach the default settings:</p>

<ul class="task-list">
<li>kamcmd defaults to connecting to unixs:/tmp/kamailio_ctl.</li>
<li>The kamailio build definitely is vulnerable as can be seen in
utils/kamctl/Makefile.</li>
</ul>

<p>More research clearly is required here.  Given these findings, the<br>
security team may want to veto the inclusion of kamailio in a stable<br>
release, which would be very unfortunate as kamailio is quite a unique<br>
piece of software with little competitors in its field.</p>

<p>Helmut</p>

<p><a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=775681">https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=775681</a></p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/kamailio/kamailio/issues/48">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZbHe1MuQbXxy6BsdjqGYvVhpAYLnks5njht6gaJpZM4DUjs_.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
  <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
    <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/48"></link>
    <meta itemprop="name" content="View Issue"></meta>
  </div>
  <meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>