Subject: [SIP] new torture tests

From: Neil Deason <[email-masked]>
Date: Mon, 13 Nov 2000 17:56:04 +0000

The following are 15 new proposed torture test messages 
based on the bis draft. None of them should cause good 
implementations to crash. Recommended responses to the 
illegal messages are given where needed.

I would greatly appreciate any additions/corrections to be
made quickly so we can try to get these folded into a new 
release of the call flows draft before the next bakeoff.

Cheers,
Neil.
-- 
Ubiquity Software Corporation, UK        http://www.ubiquity.net

1) Illegal enclosing of Request-URI  in "<>"
Server should respond with 400 + Appropriate Reason Phrase.

INVITE <sip:[email-masked]> SIP/2.0
To: sip:[email-masked]
From: sip:[email-masked]
Call-ID: [email-masked]
CSeq: 1 INVITE
Via: SIP/2.0/UDP 135.180.130.133
Content-Type: application/sdp
Content-Length: 174

v=0
o=mhandley 29739 7272939 IN IP4 126.5.4.3
s=SIP Call
t=3149328700 0
c=IN IP4 135.180.130.88
m=audio 492170 RTP/AVP 0 12
m=video 3227 RTP/AVP 31
a=rtpmap:31 LPC

2) Illegal LWS in elements of Request-URI
Server should respond with 400 + Appropriate Reason Phrase.

INVITE sip:[email-masked]; transport=udp SIP/2.0
To: sip:[email-masked]
From: sip:[email-masked]
Call-ID: [email-masked]
CSeq: 1 INVITE
Via: SIP/2.0/UDP 135.180.130.133
Content-Type: application/sdp
Content-Length: 174

v=0
o=mhandley 29739 7272939 IN IP4 126.5.4.3
s=SIP Call
t=3149328700 0
c=IN IP4 135.180.130.88
m=audio 492170 RTP/AVP 0 12
m=video 3227 RTP/AVP 31
a=rtpmap:31 LPC

3) Illegal >1 SP between elements of Request URI
Server should respond with 400 + Appropriate Reason Phrase.

INVITE sip:[email-masked]  SIP/2.0
To: sip:[email-masked]
From: sip:[email-masked]
Call-ID: [email-masked]
CSeq: 1 INVITE
Via: SIP/2.0/UDP 135.180.130.133
Content-Type: application/sdp
Content-Length: 174

v=0
o=mhandley 29739 7272939 IN IP4 126.5.4.3
s=SIP Call
t=3149328700 0
c=IN IP4 135.180.130.88
m=audio 492170 RTP/AVP 0 12
m=video 3227 RTP/AVP 31
a=rtpmap:31 LPC

4) Legal SIP URL in Request URI with escaped characters and
parameter.

INVITE sip%3Auser%40company.com;other-param=summit SIP/2.0
To: sip:[email-masked]
From: sip:[email-masked]
Call-ID: [email-masked]
CSeq: 1 INVITE
Via: SIP/2.0/UDP 135.180.130.133
Content-Type: application/sdp
Content-Length: 174

v=0
o=mhandley 29739 7272939 IN IP4 126.5.4.3
s=SIP Call
t=3149328700 0
c=IN IP4 135.180.130.88
m=audio 492170 RTP/AVP 0 12
m=video 3227 RTP/AVP 31
a=rtpmap:31 LPC

5) Illegal use of escaped header in Request-URI
Proxies should strip off the escaped header before proxying on.

INVITE sip:[email-masked]?Route=%3Csip:sip.example.com%3E
SIP/2.0
To: sip:[email-masked]
From: sip:[email-masked]
Call-ID: [email-masked]
CSeq: 1 INVITE
Via: SIP/2.0/UDP 135.180.130.133
Content-Type: application/sdp
Content-Length: 174

v=0
o=mhandley 29739 7272939 IN IP4 126.5.4.3
s=SIP Call
t=3149328700 0
c=IN IP4 135.180.130.88
m=audio 492170 RTP/AVP 0 12
m=video 3227 RTP/AVP 31
a=rtpmap:31 LPC

6) Not understood URI in Req-URI but a SIP URL in To.
Server should respond 400 + Appropriate Reason Phrase

INVITE name:user SIP/2.0
To: sip:[email-masked]
From: sip:[email-masked]
Call-ID: [email-masked]
CSeq: 1 INVITE
Via: SIP/2.0/UDP 135.180.130.133
Content-Type: application/sdp
Content-Length: 174

v=0
o=mhandley 29739 7272939 IN IP4 126.5.4.3
s=SIP Call
t=3149328700 0
c=IN IP4 135.180.130.88
m=audio 492170 RTP/AVP 0 12
m=video 3227 RTP/AVP 31
a=rtpmap:31 LPC

7) Legal no LWS between display name and <

OPTIONS sip:[email-masked] SIP/2.0
To: sip:[email-masked]
From: "caller"<sip:[email-masked]>
Call-ID: [email-masked]
CSeq: 1 OPTIONS
Via: SIP/2.0/UDP 135.180.130.133

8) Legal extra LWS between display name and <

OPTIONS sip:[email-masked] SIP/2.0
To: sip:[email-masked]
From: "caller"    <sip:[email-masked]>
Call-ID: [email-masked]
CSeq: 2 OPTIONS
Via: SIP/2.0/UDP 135.180.130.133

9) Illegal Non GMT time zone in SIP Date
A liberal server should correct this.

INVITE sip:[email-masked] SIP/2.0
To: sip:[email-masked]
From: sip:[email-masked]
Call-ID: [email-masked]
CSeq: 1 INVITE
Via: SIP/2.0/UDP 135.180.130.133
Expires: Fri, 01 Jan 2010 16:00:00 EST
Content-Type: application/sdp
Content-Length: 174

v=0
o=mhandley 29739 7272939 IN IP4 126.5.4.3
s=SIP Call
t=3149328700 0
c=IN IP4 135.180.130.88
m=audio 492170 RTP/AVP 0 12
m=video 3227 RTP/AVP 31
a=rtpmap:31 LPC

10) Legal message with passed Exipres date.
A Server should respond 408 Request Timeout.

INVITE sip:[email-masked] SIP/2.0
To: sip:[email-masked]
From: sip:[email-masked]
Call-ID: [email-masked]
CSeq: 1 INVITE
Via: SIP/2.0/UDP 135.180.130.133
Expires: Thu, 01 Dec 1994 16:00:00 GMT
Content-Type: application/sdp
Content-Length: 174

v=0
o=mhandley 29739 7272939 IN IP4 126.5.4.3
s=SIP Call
t=3149328700 0
c=IN IP4 135.180.130.88
m=audio 492170 RTP/AVP 0 12
m=video 3227 RTP/AVP 31
a=rtpmap:31 LPC

11) Legal message with zero max forwards
Proxies should return 483 Too Many Hops, a UAS responds 
as for OPTIONS.

INVITE sip:[email-masked] SIP/2.0
To: sip:[email-masked]
From: sip:[email-masked]
Call-ID: [email-masked]
CSeq: 1 INVITE
Via: SIP/2.0/UDP 135.180.130.133
Max-Forwards: 0
Content-Type: application/sdp
Content-Length: 174

v=0
o=mhandley 29739 7272939 IN IP4 126.5.4.3
s=SIP Call
t=3149328700 0
c=IN IP4 135.180.130.88
m=audio 492170 RTP/AVP 0 12
m=video 3227 RTP/AVP 31
a=rtpmap:31 LPC

12) Legal REGISTER with SIP URL containing escaped Route header
in Contact.

REGISTER sip:company.com SIP/2.0
To: sip:[email-masked]
From: sip:[email-masked]
Contact: sip:[email-masked]
Call-ID: [email-masked]
CSeq: 1 REGISTER
Via: SIP/2.0/UDP 135.180.130.133
Contact: sip:[email-masked]?Route=%3Csip:sip.example.com%3E

13) Legal but long, includes Token for Call-ID.

INVITE sip:[email-masked] SIP/2.0
To: "I have a user name of extreme proportion"
<sip:[email-masked]:6000;other-param=1234567890somethingelselong1234567890>
From: sip:[email-masked]
Call-ID:
kl24ahsd546folnyt2vbak9sad98u23naodiunzds09a3bqw0sdfbsk34poouymnae0043nsed09mfkvc74bd0cuwnms05dknw87hjpobd76f
CSeq: 1 INVITE
My-State: sldkjflzdsfaret0803adgaasd0afds0asdaasd
Via: SIP/2.0/UDP sip33.example.com
Via: SIP/2.0/UDP sip32.example.com
Via: SIP/2.0/UDP sip31.example.com
Via: SIP/2.0/UDP sip30.example.com
Via: SIP/2.0/UDP sip29.example.com
Via: SIP/2.0/UDP sip28.example.com
Via: SIP/2.0/UDP sip27.example.com
Via: SIP/2.0/UDP sip26.example.com
Via: SIP/2.0/UDP sip25.example.com
Via: SIP/2.0/UDP sip24.example.com
Via: SIP/2.0/UDP sip23.example.com
Via: SIP/2.0/UDP sip22.example.com
Via: SIP/2.0/UDP sip21.example.com
Via: SIP/2.0/UDP sip20.example.com
Via: SIP/2.0/UDP sip19.example.com
Via: SIP/2.0/UDP sip18.example.com
Via: SIP/2.0/UDP sip17.example.com
Via: SIP/2.0/UDP sip16.example.com
Via: SIP/2.0/UDP sip15.example.com
Via: SIP/2.0/UDP sip14.example.com
Via: SIP/2.0/UDP sip13.example.com
Via: SIP/2.0/UDP sip12.example.com
Via: SIP/2.0/UDP sip11.example.com
Via: SIP/2.0/UDP sip10.example.com
Via: SIP/2.0/UDP sip9.example.com
Via: SIP/2.0/UDP sip8.example.com
Via: SIP/2.0/UDP sip7.example.com
Via: SIP/2.0/UDP sip6.example.com
Via: SIP/2.0/UDP sip5.example.com
Via: SIP/2.0/UDP sip4.example.com
Via: SIP/2.0/UDP sip3.example.com
Via: SIP/2.0/UDP sip2.example.com
Via: SIP/2.0/UDP sip1.example.com
Via: SIP/2.0/UDP
host.example.com;received=135.180.130.133;branch=C1C3344E2710000000E299E568E7potato10potato0potato0
Content-Type: application/sdp

v=0
o=mhandley 29739 7272939 IN IP4 126.5.4.3
s=SIP Call
t=3149328700 0
c=IN IP4 135.180.130.88
m=audio 492170 RTP/AVP 0 12
m=video 3227 RTP/AVP 31
a=rtpmap:31 LPC

14) Illegal, badly mangled message with mutliple To, 
From, Call-ID and CSeq headers.
Server should respond 400 + Appropriate Reason Phrase

OPTIONS sip:135.180.130.133 SIP/2.0
Via: SIP/2.0/UDP company.com:5604
From: sip:[email-masked]
To: sip:[email-masked]
Call-ID: [email-masked]
CSeq: 1 OPTIONS
Expires: 0 [email-masked]
To: sip:[email-masked]
Call-ID: [email-masked]
CSeq: 1 OPTIONS
Contact: sip:host.company.com
Expires: 0xpires: 0sip:host.company.com
Expires: 0
Contact: sip:host.company.com

15) Legal message with an unusual amount of SDP attributes. 

INVITE sip:[email-masked];user=phone SIP/2.0
Via: SIP/2.0/UDP iftgw.there.com:5060
From: sip:[email-masked];user=phone
To: sip:[email-masked];user=phone
Call-ID: [email-masked]
CSeq: 56 INVITE
Content-Type: application/sdp
Content-Length: 320

v=0
o=faxgw1 2890844527 2890844527 IN IP4 iftgw.there.com
s=Session SDP
c=IN IP4 iftmg.there.com
t=0 0
m=image 49172 udptl t38
a=T38FaxVersion:0
a=T38maxBitRate:14400
a=T38FaxFillBitRemoval:0
a=T38FaxTranscodingMMR:0
a=T38FaxTranscodingJBIG:0
a=T38FaxRateManagement:transferredTCF
a=T38FaxMaxBuffer:260
a=T38FaxUdpEC:t38UDPRedundancy

_______________________________________________
SIP mailing list
[email-masked]
http://lists.bell-labs.com/mailman/listinfo/sip

---

From: "M. Ranganathan" <[email-masked]>
Date: Mon, 13 Nov 2000 16:28:50 -0500

ée¡6ÚžK¢ºh²Ø§‚Ø^±è­…«•¬Z¶+Þy÷ÞrÚ'›*Z®Ç«"zZ®ØœºV«"X¤zØ^}§-¶Ê‹¡j÷©¢Ë^uìiyË^v·º¹æzËë"·
.•ÖÞºÇŸºXŸ¶©ëâ¢ë%ŠËZ–Ê!iÛ.r§~ŠæjØ¨œˆZ½æœ¢êez‡ê¹ë-Š‰ì¢{ayú%–Œ"ž^i×«Â«{*.…«ÞºÇzÇ¥ëªç§qëj{ax#‹8Ø§¶¬Šš¶”D†Þjw¬qª^vÇª¹éÜy'œ¢wr¢èZ½ë¬yÞ4ŠzeiÇ¨~Ø^jÛayéÝ¡ûazë®v¦x‹-†+%z¥!ûaŠÈ¬•è–Ø^žØ^è¬žŒÉú+¶®±êí¢ëjw¬qª^±ê®zw~Šéj»h~¬¢¸^®v¦y j·lE©àk‚Þ©R õ.)Ñz«ž²Õ#…ëj—r«iË^®Æ§v–«jgz²
T„Ä²*wë¯¢jZŸ'(š‹azºZ©¬ºi¢µ"ÿm¢È©ºÇ«r‰©j|œ¢ak¢k"¥Æ¥•êîž+Þ®È­Éçn	©e >5ÓM5	'ªÔƒU!1‰¤ˆ?ý´ý@Ï×~uóMwÓ]÷
‰íz{SÊ—š¦™bq«b¢ìv¨ž×§´·§‚Øuï‹ô¢hZÙ^Ëo{ßÞöïowôƒH?vëž7±"	©e·}x÷}¼ïM4pƒH?wç_4×}<òf®v*8÷m{ÑÏüOÓ]¦¾'^£}¶íÏüOßV«¶™š§}K<#jx«ajsHI0½©ÜyÓ^·
+’)àMç!ž‰h‚'¬º.§]4êÞjàëŠ÷’¶Š|÷mj+az»º¸m<÷ÔÞ—}5÷¾wë®kô×ŸtÓÝö

---

From: Neil Deason <[email-masked]>
Date: Tue, 14 Nov 2000 11:40:30 +0000

"M. Ranganathan" wrote:
> 
> Tbanks for posting these (it has a laxative effect on my parser
> :).   In particular, I like the fact that you have posted
> expected return messages (it would be useful if the previous
> list also had such information). 

Please take note of Jonathan's advice about being liberal though.

> I have a couple of questions
> on the following header where you have used escape sequences:

There have been some considerable discussions on escaping SIP 
URLs in the past here. 

> Can the COLON in the sip: of the URI be an escaped sequence?
> 
> Second, you have used %40 in place of the @ at the end of the
> user name. Is this legal?  If this is legal, then   there is no
> way for the user to use an escape sequence for part of his or
> her name.

I think I have been over zealous here in my escaping.  
So I would suggest changing to the following start line:-

INVITE
sip:[email-masked];other-param=summit
SIP/2.0

This re-raises a problem with section 2.1 of bis 02
an example SIP URL is a given as sip:juser@%65xample.com:5060 
I think this escaping within a host name is illegal.

Any corrections, better suggestions for this test most welcome.
Cheers,
Neil.
--
Ubiquity Software Corporation, UK        http://www.ubiquity.net

---

From: Anders Kristensen <[email-masked]>
Date: Tue, 14 Nov 2000 15:18:33 +0100

> release of the call flows draft before the next bakeoff.

I've included some below.

> Contact: sip:[email-masked]?Route=%3Csip:sip.example.com%3E

Actually, this request is illegal.

The bis-02 draft says about the Contact header (section 6.14):

   Even if the "display-name" is empty, the "name-addr" form
   MUST be used if the "addr-spec" contains a comma, semicolon,
   or question mark.

The SIP URI in the Contact header includes a '?' char, and so the
Contact value needs to be in addr-spec form:

Contact: <sip:[email-masked]?Route=%3Csip:sip.example.com%3E>

Had the "extra stuff" been a parameter instead of a header it would be
parsed as a Contact parameter rather than a url-parameter. This would be
fine from the parsers point of view but is a common source of error
nonetheless.

In fact, this type of error is common enough to make it worth exercising
explicitly in the tests. I propose instead adding the following tests...

12a) Legal REGISTER with SIP URL containing escaped Route header
in Contact.

Contact: <sip:[email-masked]?Route=%3Csip:sip.example.com%3E>

12b) Illegal REGISTER with Contact containing header.
Server should respond with 400 + Appropriate Reason Phrase.

12c) Legal but probably doesn't mean what was intended. The 'user'
parameter should be interpreted as being a contact-param and
not a url-parameter.  The request should succeed but a subsequent
retrieval of the registration must NOT include "user=phone" as a
url-parameter.

REGISTER sip:bell-tel.com SIP/2.0
Via: SIP/2.0/UDP saturn.bell-tel.com
From: sip:[email-masked]
To: sip:[email-masked]
Call-ID: [email-masked]
CSeq: 2 REGISTER
Contact: sip:[email-masked];user=phone

12d) Same as 12c but with this Contact header:

Contact: <sip:[email-masked]>;user=phone

Other candidates...

16) Legal: display name in From/To/Contact contains multiple tokens and
is unqouted:

INVITE sip:[email-masked] SIP/2.0
Via:     SIP/2.0/UDP c.bell-tel.com
From:    A. Bell <sip:[email-masked]>
To:      T. Watson <sip:[email-masked]>
Call-ID: [email-masked]
CSeq:    1 INVITE

17) Illegal: unquoted display name in From/To/Contact contains non-token
characters.
Server should respond with 400 + Appropriate Reason Phrase.

INVITE sip:[email-masked] SIP/2.0
Via:     SIP/2.0/UDP c.bell-tel.com
From:    Bell, Alexander <sip:[email-masked]>
To:      Watson, Thomas <sip:[email-masked]>
Call-ID: [email-masked]
CSeq:    1 INVITE

18) Unknown (higher) protocol version in request line.
Server should respond with 400 + Appropriate Reason Phrase.

INVITE sip:[email-masked] SIP/7.0
Via:     SIP/2.0/UDP c.bell-tel.com
From:    A. Bell <sip:[email-masked]>
To:      T. Watson <sip:[email-masked]>
Call-ID: [email-masked]
CSeq:    1 INVITE

19) Legal leading zero in protocol version numbers

INVITE sip:[email-masked] SIP/02.00
Via:     SIP/2.0/UDP c.bell-tel.com
From:    A. Bell <sip:[email-masked]>
To:      T. Watson <sip:[email-masked]>
Call-ID: [email-masked]
CSeq:    1 INVITE

Cheers,
Anders