Jump to content


Photo

SNOM auth bug?


  • Please log in to reply
2 replies to this topic

#1 Jaco Kroon

Jaco Kroon

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 25 May 2010 - 07:12 AM

Hi all,

I'm seeing an issue where a SNOM300 is failing digest authentication, resulting in a 403 response from asterisk, and then failing to re-register, resulting in an unreachable phone. The phone also refuses to make outbound calls, waiting for the user to enter a valid password (which usually don't happen because users don't look on their screens and just pick up the handset and type the number they want to dial).

Anyway, the sequence that seems to "break" the phone is this registration sequence (C = client - SNOM300 phone, S = server - asterisk 1.6.1.18), shown headers from actual tcpdump trace:

C: REGISTER (no Authorization header)
S: 401 Unauthorized (with WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="392f86fa")
C: REGISTER (no Authorization header)
S: 401 Unauthorized (with WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="5a037d80")
C: REGISTER (with Authorization: Digest username="8101",realm="asterisk",nonce="392f86fa",uri="sip:192.168.61.5",response="e906a2ac3a04d32ad1ae049e1ff4686c",algorithm=MD5)
S: 403 Forbidden (Bad auth)

I've calculated the responses to both the nonce values (only param not available above that's required for the calculation is the secret of 1018), and they should be 94ce05d06f7a840d07ed7444b9b1a49a and 952110462bdf435109bb6d241b4348eb respectively. Thus the response given here doesn't match either of the two nonce values. Had it at least matched the expected response for 392f86fa then instead of 403 it would have received yet another 401 with new nonce and stale=true (based on perusal of the asterisk code) indicating that auth succeeded but that the nonce isn't current. As it stands I'm unsure of what's going wrong. The SIP traffic for the above exchange as per the following:

14:22:51.078120 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 847)
    192.168.61.203.2051 > 192.168.61.5.5060: SIP, length: 819
	REGISTER sip:192.168.61.5 SIP/2.0
	Via: SIP/2.0/UDP 192.168.61.203:2051;branch=z9hG4bK-2wygbpa3j0db;rport
	From: "Sarah Mphse" <sip:8101@192.168.61.5>;tag=1e6ii2tg98
	To: "Sarah Mphse" <sip:8101@192.168.61.5>
	Call-ID: 3c2d5d99668a-ywdyvj1urakb@snom300-0004132F2F05
	CSeq: 7173 REGISTER
	Max-Forwards: 70
	Contact: <sip:8101@192.168.61.203:2051;line=3vmwqpfb>;flow-id=1;q=1.0;+sip.instance="<urn:uuid:bb8bb88d-7d1f-4f21-83c0-ad563294eab1>";audio;mobility="fixed";duplex="full";description="snom300";actor="principal";events="dialog";methods="INVITE,ACK,CANCEL,BYE,REFER,OPTIONS,NOTIFY,SUBSCRIBE,PRACK,MESSAGE,INFO"
	Contact: <http://192.168.61.203:80>
	Contact: <https://192.168.61.203:443>
	User-Agent: snom300/6.5.17
	Supported: gruu
	Allow-Events: dialog
	X-Real-IP: 192.168.61.203
	Expires: 0
	Content-Length: 0
	
	
14:22:51.078261 IP (tos 0x60, ttl 64, id 59305, offset 0, flags [none], proto UDP (17), length 581)
    192.168.61.5.5060 > 192.168.61.203.2051: SIP, length: 553
	SIP/2.0 401 Unauthorized
	Via: SIP/2.0/UDP 192.168.61.203:2051;branch=z9hG4bK-2wygbpa3j0db;received=192.168.61.203;rport=2051
	From: "Sarah Mphse" <sip:8101@192.168.61.5>;tag=1e6ii2tg98
	To: "Sarah Mphse" <sip:8101@192.168.61.5>;tag=as30432a13
	Call-ID: 3c2d5d99668a-ywdyvj1urakb@snom300-0004132F2F05
	CSeq: 7173 REGISTER
	Server: Asterisk PBX 1.6.1.18
	Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
	Supported: replaces, timer
	WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="392f86fa"
	Content-Length: 0
	
	
14:22:51.098723 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 850)
    192.168.61.203.2051 > 192.168.61.5.5060: SIP, length: 822
	REGISTER sip:192.168.61.5 SIP/2.0
	Via: SIP/2.0/UDP 192.168.61.203:2051;branch=z9hG4bK-te8pelgwmcsk;rport
	From: "Sarah Mphse" <sip:8101@192.168.61.5>;tag=43edjnlibz
	To: "Sarah Mphse" <sip:8101@192.168.61.5>
	Call-ID: 3c2ea2609c40-qzm2wnpq2ec0@snom300-0004132F2F05
	CSeq: 7174 REGISTER
	Max-Forwards: 70
	Contact: <sip:8101@192.168.61.203:2051;line=e3k8qn8n>;flow-id=1;q=1.0;+sip.instance="<urn:uuid:274ea2ea-e572-4fe5-92b4-8d0e5fd08862>";audio;mobility="fixed";duplex="full";description="snom300";actor="principal";events="dialog";methods="INVITE,ACK,CANCEL,BYE,REFER,OPTIONS,NOTIFY,SUBSCRIBE,PRACK,MESSAGE,INFO"
	Contact: <http://192.168.61.203:80>
	Contact: <https://192.168.61.203:443>
	User-Agent: snom300/6.5.17
	Supported: gruu
	Allow-Events: dialog
	X-Real-IP: 192.168.61.203
	Expires: 3600
	Content-Length: 0
	
	
14:22:51.099017 IP (tos 0x60, ttl 64, id 59306, offset 0, flags [none], proto UDP (17), length 581)
    192.168.61.5.5060 > 192.168.61.203.2051: SIP, length: 553
	SIP/2.0 401 Unauthorized
	Via: SIP/2.0/UDP 192.168.61.203:2051;branch=z9hG4bK-te8pelgwmcsk;received=192.168.61.203;rport=2051
	From: "Sarah Mphse" <sip:8101@192.168.61.5>;tag=43edjnlibz
	To: "Sarah Mphse" <sip:8101@192.168.61.5>;tag=as5acbf5f6
	Call-ID: 3c2ea2609c40-qzm2wnpq2ec0@snom300-0004132F2F05
	CSeq: 7174 REGISTER
	Server: Asterisk PBX 1.6.1.18
	Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
	Supported: replaces, timer
	WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="5a037d80"
	Content-Length: 0
	
	
14:22:51.185107 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 1001)
    192.168.61.203.2051 > 192.168.61.5.5060: SIP, length: 973
	REGISTER sip:192.168.61.5 SIP/2.0
	Via: SIP/2.0/UDP 192.168.61.203:2051;branch=z9hG4bK-60gyrkyrwqv6;rport
	From: "Sarah Mphse" <sip:8101@192.168.61.5>;tag=1e6ii2tg98
	To: "Sarah Mphse" <sip:8101@192.168.61.5>
	Call-ID: 3c2d5d99668a-ywdyvj1urakb@snom300-0004132F2F05
	CSeq: 7174 REGISTER
	Max-Forwards: 70
	Contact: <sip:8101@192.168.61.203:2051;line=3vmwqpfb>;flow-id=1;q=1.0;+sip.instance="<urn:uuid:bb8bb88d-7d1f-4f21-83c0-ad563294eab1>";audio;mobility="fixed";duplex="full";description="snom300";actor="principal";events="dialog";methods="INVITE,ACK,CANCEL,BYE,REFER,OPTIONS,NOTIFY,SUBSCRIBE,PRACK,MESSAGE,INFO"
	Contact: <http://192.168.61.203:80>
	Contact: <https://192.168.61.203:443>
	User-Agent: snom300/6.5.17
	Supported: gruu
	Allow-Events: dialog
	X-Real-IP: 192.168.61.203
	Authorization: Digest username="8101",realm="asterisk",nonce="392f86fa",uri="sip:192.168.61.5",response="e906a2ac3a04d32ad1ae049e1ff4686c",algorithm=MD5
	Expires: 0
	Content-Length: 0
	
	
14:22:51.185186 IP (tos 0x60, ttl 64, id 59307, offset 0, flags [none], proto UDP (17), length 513)
    192.168.61.5.5060 > 192.168.61.203.2051: SIP, length: 485
	SIP/2.0 403 Forbidden (Bad auth)
	Via: SIP/2.0/UDP 192.168.61.203:2051;branch=z9hG4bK-60gyrkyrwqv6;received=192.168.61.203;rport=2051
	From: "Sarah Mphse" <sip:8101@192.168.61.5>;tag=1e6ii2tg98
	To: "Sarah Mphse" <sip:8101@192.168.61.5>;tag=as30432a13
	Call-ID: 3c2d5d99668a-ywdyvj1urakb@snom300-0004132F2F05
	CSeq: 7174 REGISTER
	Server: Asterisk PBX 1.6.1.18
	Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
	Supported: replaces, timer
	Content-Length: 0

The SIP traffic since the previous successful registration as per the following (showing that no call attempts that could possibly trigger password prompts was made):

14:20:37.773384 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 850)
    192.168.61.203.2051 > 192.168.61.5.5060: SIP, length: 822
	REGISTER sip:192.168.61.5 SIP/2.0
	Via: SIP/2.0/UDP 192.168.61.203:2051;branch=z9hG4bK-1r5sdt1rj980;rport
	From: "Sarah Mphse" <sip:8101@192.168.61.5>;tag=ts8bxfms7z
	To: "Sarah Mphse" <sip:8101@192.168.61.5>
	Call-ID: 3c2d5d99668a-ywdyvj1urakb@snom300-0004132F2F05
	CSeq: 7171 REGISTER
	Max-Forwards: 70
	Contact: <sip:8101@192.168.61.203:2051;line=3vmwqpfb>;flow-id=1;q=1.0;+sip.instance="<urn:uuid:bb8bb88d-7d1f-4f21-83c0-ad563294eab1>";audio;mobility="fixed";duplex="full";description="snom300";actor="principal";events="dialog";methods="INVITE,ACK,CANCEL,BYE,REFER,OPTIONS,NOTIFY,SUBSCRIBE,PRACK,MESSAGE,INFO"
	Contact: <http://192.168.61.203:80>
	Contact: <https://192.168.61.203:443>
	User-Agent: snom300/6.5.17
	Supported: gruu
	Allow-Events: dialog
	X-Real-IP: 192.168.61.203
	Expires: 3600
	Content-Length: 0
	
	
14:20:37.773516 IP (tos 0x60, ttl 64, id 59300, offset 0, flags [none], proto UDP (17), length 581)
    192.168.61.5.5060 > 192.168.61.203.2051: SIP, length: 553
	SIP/2.0 401 Unauthorized
	Via: SIP/2.0/UDP 192.168.61.203:2051;branch=z9hG4bK-1r5sdt1rj980;received=192.168.61.203;rport=2051
	From: "Sarah Mphse" <sip:8101@192.168.61.5>;tag=ts8bxfms7z
	To: "Sarah Mphse" <sip:8101@192.168.61.5>;tag=as00ba039c
	Call-ID: 3c2d5d99668a-ywdyvj1urakb@snom300-0004132F2F05
	CSeq: 7171 REGISTER
	Server: Asterisk PBX 1.6.1.18
	Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
	Supported: replaces, timer
	WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="7a322367"
	Content-Length: 0
	
	
14:20:37.815408 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 1004)
    192.168.61.203.2051 > 192.168.61.5.5060: SIP, length: 976
	REGISTER sip:192.168.61.5 SIP/2.0
	Via: SIP/2.0/UDP 192.168.61.203:2051;branch=z9hG4bK-6asqlrrdh3au;rport
	From: "Sarah Mphse" <sip:8101@192.168.61.5>;tag=ts8bxfms7z
	To: "Sarah Mphse" <sip:8101@192.168.61.5>
	Call-ID: 3c2d5d99668a-ywdyvj1urakb@snom300-0004132F2F05
	CSeq: 7172 REGISTER
	Max-Forwards: 70
	Contact: <sip:8101@192.168.61.203:2051;line=3vmwqpfb>;flow-id=1;q=1.0;+sip.instance="<urn:uuid:bb8bb88d-7d1f-4f21-83c0-ad563294eab1>";audio;mobility="fixed";duplex="full";description="snom300";actor="principal";events="dialog";methods="INVITE,ACK,CANCEL,BYE,REFER,OPTIONS,NOTIFY,SUBSCRIBE,PRACK,MESSAGE,INFO"
	Contact: <http://192.168.61.203:80>
	Contact: <https://192.168.61.203:443>
	User-Agent: snom300/6.5.17
	Supported: gruu
	Allow-Events: dialog
	X-Real-IP: 192.168.61.203
	Authorization: Digest username="8101",realm="asterisk",nonce="7a322367",uri="sip:192.168.61.5",response="b062e54aef5416578d47e92a8aafe751",algorithm=MD5
	Expires: 3600
	Content-Length: 0
	
	
14:20:37.859574 IP (tos 0x60, ttl 64, id 59301, offset 0, flags [none], proto UDP (17), length 590)
    192.168.61.5.5060 > 192.168.61.203.2051: SIP, length: 562
	OPTIONS sip:8101@192.168.61.203:2051;line=3vmwqpfb SIP/2.0
	Via: SIP/2.0/UDP 192.168.61.5:5060;branch=z9hG4bK0c422009;rport
	Max-Forwards: 70
	From: "asterisk" <sip:asterisk@192.168.61.5>;tag=as441eab40
	To: <sip:8101@192.168.61.203:2051;line=3vmwqpfb>
	Contact: <sip:asterisk@192.168.61.5>
	Call-ID: 108111785b3424141ea3f8110d501047@192.168.61.5
	CSeq: 102 OPTIONS
	User-Agent: Asterisk PBX 1.6.1.18
	Date: Thu, 20 May 2010 12:20:37 GMT
	Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
	Supported: replaces, timer
	Content-Length: 0
	
	
14:20:37.859615 IP (tos 0x60, ttl 64, id 59302, offset 0, flags [none], proto UDP (17), length 613)
    192.168.61.5.5060 > 192.168.61.203.2051: SIP, length: 585
	SIP/2.0 200 OK
	Via: SIP/2.0/UDP 192.168.61.203:2051;branch=z9hG4bK-6asqlrrdh3au;received=192.168.61.203;rport=2051
	From: "Sarah Mphse" <sip:8101@192.168.61.5>;tag=ts8bxfms7z
	To: "Sarah Mphse" <sip:8101@192.168.61.5>;tag=as00ba039c
	Call-ID: 3c2d5d99668a-ywdyvj1urakb@snom300-0004132F2F05
	CSeq: 7172 REGISTER
	Server: Asterisk PBX 1.6.1.18
	Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
	Supported: replaces, timer
	Expires: 300
	Contact: <sip:8101@192.168.61.203:2051;line=3vmwqpfb>;expires=300
	Date: Thu, 20 May 2010 12:20:37 GMT
	Content-Length: 0
	
	
14:20:37.905312 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 629)
    192.168.61.203.2051 > 192.168.61.5.5060: SIP, length: 601
	SIP/2.0 200 OK
	Via: SIP/2.0/UDP 192.168.61.5:5060;branch=z9hG4bK0c422009;rport=5060
	From: "asterisk" <sip:asterisk@192.168.61.5>;tag=as441eab40
	To: <sip:8101@192.168.61.203:2051;line=3vmwqpfb>
	Call-ID: 108111785b3424141ea3f8110d501047@192.168.61.5
	CSeq: 102 OPTIONS
	Contact: <sip:8101@192.168.61.203:2051;line=3vmwqpfb>;flow-id=1
	User-Agent: snom300/6.5.17
	Accept-Language: en
	Accept: application/sdp
	Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE, PRACK, MESSAGE, INFO
	Allow-Events: talk, hold, refer
	Supported: timer, 100rel, replaces, callerid
	Content-Length: 0
	
	
14:21:37.905164 IP (tos 0x60, ttl 64, id 59303, offset 0, flags [none], proto UDP (17), length 590)
    192.168.61.5.5060 > 192.168.61.203.2051: SIP, length: 562
	OPTIONS sip:8101@192.168.61.203:2051;line=3vmwqpfb SIP/2.0
	Via: SIP/2.0/UDP 192.168.61.5:5060;branch=z9hG4bK3813dac2;rport
	Max-Forwards: 70
	From: "asterisk" <sip:asterisk@192.168.61.5>;tag=as6c11f8d1
	To: <sip:8101@192.168.61.203:2051;line=3vmwqpfb>
	Contact: <sip:asterisk@192.168.61.5>
	Call-ID: 23b4ed756264a9b13de665180eba091c@192.168.61.5
	CSeq: 102 OPTIONS
	User-Agent: Asterisk PBX 1.6.1.18
	Date: Thu, 20 May 2010 12:21:37 GMT
	Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
	Supported: replaces, timer
	Content-Length: 0
	
	
14:21:37.920705 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 629)
    192.168.61.203.2051 > 192.168.61.5.5060: SIP, length: 601
	SIP/2.0 200 OK
	Via: SIP/2.0/UDP 192.168.61.5:5060;branch=z9hG4bK3813dac2;rport=5060
	From: "asterisk" <sip:asterisk@192.168.61.5>;tag=as6c11f8d1
	To: <sip:8101@192.168.61.203:2051;line=3vmwqpfb>
	Call-ID: 23b4ed756264a9b13de665180eba091c@192.168.61.5
	CSeq: 102 OPTIONS
	Contact: <sip:8101@192.168.61.203:2051;line=3vmwqpfb>;flow-id=1
	User-Agent: snom300/6.5.17
	Accept-Language: en
	Accept: application/sdp
	Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE, PRACK, MESSAGE, INFO
	Allow-Events: talk, hold, refer
	Supported: timer, 100rel, replaces, callerid
	Content-Length: 0
	
	
14:22:37.920897 IP (tos 0x60, ttl 64, id 59304, offset 0, flags [none], proto UDP (17), length 590)
    192.168.61.5.5060 > 192.168.61.203.2051: SIP, length: 562
	OPTIONS sip:8101@192.168.61.203:2051;line=3vmwqpfb SIP/2.0
	Via: SIP/2.0/UDP 192.168.61.5:5060;branch=z9hG4bK3ff75a70;rport
	Max-Forwards: 70
	From: "asterisk" <sip:asterisk@192.168.61.5>;tag=as713d593d
	To: <sip:8101@192.168.61.203:2051;line=3vmwqpfb>
	Contact: <sip:asterisk@192.168.61.5>
	Call-ID: 600fc48e33106ddc3738b2116e2314d6@192.168.61.5
	CSeq: 102 OPTIONS
	User-Agent: Asterisk PBX 1.6.1.18
	Date: Thu, 20 May 2010 12:22:37 GMT
	Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
	Supported: replaces, timer
	Content-Length: 0
	
	
14:22:37.936548 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 629)
    192.168.61.203.2051 > 192.168.61.5.5060: SIP, length: 601
	SIP/2.0 200 OK
	Via: SIP/2.0/UDP 192.168.61.5:5060;branch=z9hG4bK3ff75a70;rport=5060
	From: "asterisk" <sip:asterisk@192.168.61.5>;tag=as713d593d
	To: <sip:8101@192.168.61.203:2051;line=3vmwqpfb>
	Call-ID: 600fc48e33106ddc3738b2116e2314d6@192.168.61.5
	CSeq: 102 OPTIONS
	Contact: <sip:8101@192.168.61.203:2051;line=3vmwqpfb>;flow-id=1
	User-Agent: snom300/6.5.17
	Accept-Language: en
	Accept: application/sdp
	Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE, PRACK, MESSAGE, INFO
	Allow-Events: talk, hold, refer
	Supported: timer, 100rel, replaces, callerid
	Content-Length: 0

I'm at a loss for words on this one, out of ideas and with no idea of how to proceed in order to trouble-shoot this one. Any and all ideas would be very welcome.

#2 snomy

snomy

    Snom Support Team

  • Members
  • PipPipPipPipPip
  • 532 posts
  • Gender:Male
  • Location:Berlin

Posted 25 May 2010 - 12:29 PM

You are using 6.5.17, I suggest to use a more recent firmware!

#3 Jaco Kroon

Jaco Kroon

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 25 May 2010 - 12:37 PM

You are using 6.5.17, I suggest to use a more recent firmware!


Already requested the client to update the firmware. Will check what happens and let you know.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users