<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>13637</bug_id>
          
          <creation_ts>2007-12-08 17:04:49 +0300</creation_ts>
          <short_desc>cupsd по умолчанию принимает UDP соединения отовсюду, а не только с localhost</short_desc>
          <delta_ts>2013-10-03 21:20:16 +0400</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>cups</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>14167</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Olvin">olvin</reporter>
          <assigned_to name="Anton Farygin">rider</assigned_to>
          <cc>anubix</cc>
    
    <cc>george</cc>
    
    <cc>lav</cc>
    
    <cc>ldv</cc>
    
    <cc>mike</cc>
    
    <cc>rider</cc>
    
    <cc>shakirov</cc>
    
    <cc>vvk</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>59192</commentid>
    <comment_count>0</comment_count>
    <who name="Olvin">olvin</who>
    <bug_when>2007-12-08 17:04:55 +0300</bug_when>
    <thetext>cupsd сразу после установки принимает соединения отовсюду, а не только с
localhost. Причём запускается этот сервер из-под пользователя root, т.е.
потенциально уязвим как из локальной сети, так из через Интернет (если до
настройки доступа не закрыть firewall&apos;ом).

Actual Results:  
cupsd принимает запросы отовсюду, т.е. слушает 0.0.0.0:631/udp

Expected Results:  
cupsd принимает запросы только от localhost, т.е. слушает 127.0.0.1:631/udp</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59266</commentid>
    <comment_count>1</comment_count>
    <who name="inger@altlinux.org">inger</who>
    <bug_when>2007-12-10 10:32:57 +0300</bug_when>
    <thetext># netlist -a|grep cups
root     6106  cupsd    1 tcp       127.0.0.1:631           0.0.0.0:0     LISTEN
root     6106  cupsd    4 udp         0.0.0.0:631           0.0.0.0:0     CLOSE

---cupsd.conf---
# Only listen for connections from the local machine.
Listen localhost:631

---
То есть по udp он вроде как ничего не слушает.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59278</commentid>
    <comment_count>2</comment_count>
    <who name="Olvin">olvin</who>
    <bug_when>2007-12-10 13:56:32 +0300</bug_when>
    <thetext>OK. А как насчёт такого (уже не netlist, а netstat):

[root@ald40 ~]# netstat -avpn 2&gt;/dev/null|grep cups
tcp        0      0 127.0.0.1:631               0.0.0.0:*                  
LISTEN      3651/cupsd
udp        0      0 0.0.0.0:631                 0.0.0.0:*                      
        3651/cupsd
unix  2      [ ACC ]     STREAM     LISTENING     12746  3651/cupsd         
/var/run/cups/cups.sock

Как прокомментируете? Зачем оно вообще висит на 0.0.0.0, если ему сказано
слушать только localhost? Я понимаю, что вроде бы не слушает, но сам факт того,
что есть такая строчка в выводе настораживает.

Скорее всего, помечу как INVALID, но дождусь вашего комментария.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59290</commentid>
    <comment_count>3</comment_count>
    <who name="inger@altlinux.org">inger</who>
    <bug_when>2007-12-10 18:35:46 +0300</bug_when>
    <thetext>без понятия зачем ему ещё и UDP-шный порт ;)
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59305</commentid>
    <comment_count>4</comment_count>
    <who name="Olvin">olvin</who>
    <bug_when>2007-12-10 23:21:42 +0300</bug_when>
    <thetext>(In reply to comment #3)
&gt; без понятия зачем ему ещё и UDP-шный порт ;)
&gt; 

Нда... Так он всё-таки слушает или нет? :)
Resolved bug: INVALID
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59325</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Shigorin">mike</who>
    <bug_when>2007-12-11 01:47:05 +0300</bug_when>
    <thetext>(In reply to comment #3)
&gt; без понятия зачем ему ещё и UDP-шный порт ;)

Вероятно, для какого-нить обнаружения по бродкастам.

Судя по nmap, UDP он слушает...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59336</commentid>
    <comment_count>6</comment_count>
    <who name="Olvin">olvin</who>
    <bug_when>2007-12-11 12:44:17 +0300</bug_when>
    <thetext>(In reply to comment #5)
&gt;&gt; без понятия зачем ему ещё и UDP-шный порт ;)
&gt; Вероятно, для какого-нить обнаружения по бродкастам.
&gt; Судя по nmap, UDP он слушает...

Так что - получается, уязвим?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59368</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Shigorin">mike</who>
    <bug_when>2007-12-11 20:05:22 +0300</bug_when>
    <thetext>слушает != уязвим</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59372</commentid>
    <comment_count>8</comment_count>
    <who name="Olvin">olvin</who>
    <bug_when>2007-12-11 20:23:44 +0300</bug_when>
    <thetext>(In reply to comment #7)
&gt; слушает != уязвим

слушает ~ потенциально уязвим
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59407</commentid>
    <comment_count>9</comment_count>
    <who name="inger@altlinux.org">inger</who>
    <bug_when>2007-12-12 10:13:55 +0300</bug_when>
    <thetext>Скажите control cups local и расслабтесь, даже на localhost слушать не будет ;)

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59409</commentid>
    <comment_count>10</comment_count>
    <who name="Olvin">olvin</who>
    <bug_when>2007-12-12 11:14:51 +0300</bug_when>
    <thetext>&gt; Скажите control cups local и расслабтесь, даже на localhost слушать не будет ;)

В общем, это надо сделать по умолчанию. А то слушает ведь, причём зря и
небезопасно, в общем случае.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59410</commentid>
    <comment_count>11</comment_count>
    <who name="inger@altlinux.org">inger</who>
    <bug_when>2007-12-12 12:04:58 +0300</bug_when>
    <thetext>нет, по умолчанию будет наименее проблемный вариант ... мы уже проходили, когда
делаешь параною а потом выслушиваешь ругань пользователей ;)
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59415</commentid>
    <comment_count>12</comment_count>
    <who name="Olvin">olvin</who>
    <bug_when>2007-12-12 14:28:05 +0300</bug_when>
    <thetext>&gt; нет, по умолчанию будет наименее проблемный вариант ... мы уже проходили, когда
&gt; делаешь параною а потом выслушиваешь ругань пользователей ;)

Тогда нужно сделать эту службу недоступной из сети не 127.0.0.1 ИЛИ запускаемой
не из-под root.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71700</commentid>
    <comment_count>13</comment_count>
    <who name="Mikhail Gusarov">dottedmag</who>
    <bug_when>2008-06-13 12:59:26 +0400</bug_when>
    <thetext></thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77822</commentid>
    <comment_count>14</comment_count>
    <who name="Zerg">anubix</who>
    <bug_when>2008-09-16 02:37:16 +0400</bug_when>
    <thetext>Галку в альтераторе?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114929</commentid>
    <comment_count>15</comment_count>
    <who name="Lenar Shakirov">shakirov</who>
    <bug_when>2010-11-06 14:37:41 +0300</bug_when>
    <thetext>Воспроизводится:
cups-1.4.4-alt2

# netstat -anlpu | grep cups
udp  0  0 0.0.0.0:631  0.0.0.0:*  3768/cupsd

Перевешиваю на Сизиф</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115003</commentid>
    <comment_count>16</comment_count>
    <who name="Michael Shigorin">mike</who>
    <bug_when>2010-11-06 22:49:42 +0300</bug_when>
    <thetext>Не уверен, что есть большой смысл отрывать ему и обнаружение по UDP... разве что control cups paranoid какой.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>142965</commentid>
    <comment_count>17</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2013-10-03 21:20:16 +0400</bug_when>
    <thetext>
(В ответ на комментарий №2)
&gt; OK. А как насчёт такого (уже не netlist, а netstat):
&gt; 
&gt; [root@ald40 ~]# netstat -avpn 2&gt;/dev/null|grep cups
&gt; tcp        0      0 127.0.0.1:631               0.0.0.0:*                  
&gt; LISTEN      3651/cupsd
&gt; udp        0      0 0.0.0.0:631                 0.0.0.0:*                      
&gt;         3651/cupsd
&gt; unix  2      [ ACC ]     STREAM     LISTENING     12746  3651/cupsd         
&gt; /var/run/cups/cups.sock

Больше не слушает:
 # rpm -q cups
cups-1.6.2-alt3

# netstat -avpn 2&gt;/dev/null|grep cups
tcp        0      0 0.0.0.0:631                 0.0.0.0:*                   LISTEN      26898/cupsd         
tcp        0      0 :::631                      :::*                        LISTEN      26898/cupsd  


# netstat -anlpu | grep cups
(ничего не выводит)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>