UAC module causing malformed CANCEL

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

UAC module causing malformed CANCEL

Ben Newlin

Hello,

 

I have found an issue with using the UAC module to replace the From/To headers. When one of these headers is the last header in a SIP INVITE, the UAC module is injecting an extra line break in subsequent CANCEL requests causing an invalid request. This happens when either of these headers are the last header in the originally received INVITE, but also if they become the last header due to modifications made to the original INVITE, e.g. if the last 2 headers were To followed by P-Asserted-Identity and the script processing calls remove_hf(“P-Asserted-Identity”) thus making the To header last.

 

I have only seen this happen on a CANCEL request. Other sequential requests like BYE or re-INVITE are not malformed.

 

A tcpdump capture of the message sequence can be found here: https://pastebin.com/myDVU5Jz. Note the extra whitespace line in the second CANCEL message forwarded from OpenSIPS (203.0.113.3).

 

Ben Newlin


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: UAC module causing malformed CANCEL

Bogdan-Andrei Iancu-2
Hi Ben,

Thanks for the report - could you please open a bug report on GITHUB with the relevant information ? It will be easier for us to track it.

Best regards,
Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Summit 2019
  https://www.opensips.org/events/Summit-2019Amsterdam/
On 12/05/2018 05:17 PM, Ben Newlin wrote:

Hello,

 

I have found an issue with using the UAC module to replace the From/To headers. When one of these headers is the last header in a SIP INVITE, the UAC module is injecting an extra line break in subsequent CANCEL requests causing an invalid request. This happens when either of these headers are the last header in the originally received INVITE, but also if they become the last header due to modifications made to the original INVITE, e.g. if the last 2 headers were To followed by P-Asserted-Identity and the script processing calls remove_hf(“P-Asserted-Identity”) thus making the To header last.

 

I have only seen this happen on a CANCEL request. Other sequential requests like BYE or re-INVITE are not malformed.

 

A tcpdump capture of the message sequence can be found here: https://pastebin.com/myDVU5Jz. Note the extra whitespace line in the second CANCEL message forwarded from OpenSIPS (203.0.113.3).

 

Ben Newlin



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: UAC module causing malformed CANCEL

Ben Newlin

Bogdan,

 

Certainly. I was going to ask next if that would be a better place to report the issue.

 

I have opened an issue here: https://github.com/OpenSIPS/opensips/issues/1555

 

Ben Newlin

 

From: Bogdan-Andrei Iancu <[hidden email]>
Date: Friday, December 7, 2018 at 12:16 PM
To: OpenSIPS users mailling list <[hidden email]>, Ben Newlin <[hidden email]>
Subject: Re: [OpenSIPS-Users] UAC module causing malformed CANCEL

 

Hi Ben,

Thanks for the report - could you please open a bug report on GITHUB with the relevant information ? It will be easier for us to track it.

Best regards,

Bogdan-Andrei Iancu
 
OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Summit 2019
  https://www.opensips.org/events/Summit-2019Amsterdam/

On 12/05/2018 05:17 PM, Ben Newlin wrote:

Hello,

 

I have found an issue with using the UAC module to replace the From/To headers. When one of these headers is the last header in a SIP INVITE, the UAC module is injecting an extra line break in subsequent CANCEL requests causing an invalid request. This happens when either of these headers are the last header in the originally received INVITE, but also if they become the last header due to modifications made to the original INVITE, e.g. if the last 2 headers were To followed by P-Asserted-Identity and the script processing calls remove_hf(“P-Asserted-Identity”) thus making the To header last.

 

I have only seen this happen on a CANCEL request. Other sequential requests like BYE or re-INVITE are not malformed.

 

A tcpdump capture of the message sequence can be found here: https://pastebin.com/myDVU5Jz. Note the extra whitespace line in the second CANCEL message forwarded from OpenSIPS (203.0.113.3).

 

Ben Newlin




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: UAC module causing malformed CANCEL

Bogdan-Andrei Iancu-2
Hi Ben,

Found it, thank you.

Regards,
Bogdan
Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Summit 2019
  https://www.opensips.org/events/Summit-2019Amsterdam/
On 12/07/2018 08:10 PM, Ben Newlin wrote:

Bogdan,

 

Certainly. I was going to ask next if that would be a better place to report the issue.

 

I have opened an issue here: https://github.com/OpenSIPS/opensips/issues/1555

 

Ben Newlin

 

From: Bogdan-Andrei Iancu [hidden email]
Date: Friday, December 7, 2018 at 12:16 PM
To: OpenSIPS users mailling list [hidden email], Ben Newlin [hidden email]
Subject: Re: [OpenSIPS-Users] UAC module causing malformed CANCEL

 

Hi Ben,

Thanks for the report - could you please open a bug report on GITHUB with the relevant information ? It will be easier for us to track it.

Best regards,

Bogdan-Andrei Iancu
 
OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Summit 2019
  https://www.opensips.org/events/Summit-2019Amsterdam/

On 12/05/2018 05:17 PM, Ben Newlin wrote:

Hello,

 

I have found an issue with using the UAC module to replace the From/To headers. When one of these headers is the last header in a SIP INVITE, the UAC module is injecting an extra line break in subsequent CANCEL requests causing an invalid request. This happens when either of these headers are the last header in the originally received INVITE, but also if they become the last header due to modifications made to the original INVITE, e.g. if the last 2 headers were To followed by P-Asserted-Identity and the script processing calls remove_hf(“P-Asserted-Identity”) thus making the To header last.

 

I have only seen this happen on a CANCEL request. Other sequential requests like BYE or re-INVITE are not malformed.

 

A tcpdump capture of the message sequence can be found here: https://pastebin.com/myDVU5Jz. Note the extra whitespace line in the second CANCEL message forwarded from OpenSIPS (203.0.113.3).

 

Ben Newlin




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users





_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users