[asterisk-bugs] [JIRA] (ASTERISK-29664) PJSIP processing token with % incorrectly

Friendly Automation (JIRA) noreply at issues.asterisk.org
Wed Jan 5 13:16:07 CST 2022


    [ https://issues.asterisk.org/jira/browse/ASTERISK-29664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=257642#comment-257642 ] 

Friendly Automation commented on ASTERISK-29664:
------------------------------------------------

Change 17783 merged by Friendly Automation:
pjproject: Fix incorrect unescaping of tokens during parsing

[https://gerrit.asterisk.org/c/asterisk/+/17783|https://gerrit.asterisk.org/c/asterisk/+/17783]

> PJSIP processing token with % incorrectly
> -----------------------------------------
>
>                 Key: ASTERISK-29664
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-29664
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: pjproject/pjsip
>    Affects Versions: 16.17.0
>         Environment: Ubuntu 18
>            Reporter: Dan Cropp
>            Assignee: Unassigned
>            Severity: Major
>
> We have a SIP provider who sends an INVITE with a Branch header.
> Everything is fine in most cases.  However, there are times they send a Branch header with a % character.
> From what I have been told, the header is a token, so it is acceptable to include the % character.
> There seem to be two different issues with PJSIP processing of headers with the % character in tokenized fields.
> Example.
> branch=z9hG4bKf5s1psess0KGj0gRsgyJIBWEYL%QWIjkWmDXr8xnPVgaOBzOLSV28
> In one case, it can receive the portion and process it, but when sending out the same token it changes it to lower case.  Example, received %8A portion, but sent %8a.  This means it’s not a match for the token so the other side will not match.
> Received
> branch=z9hG4bKf5s1psess0gbkeviMkQYREmK31pLWRKQ+FRmVzHQNG1Xv%8AnzLVA!;extension=QKIT3jRNBcmZT7yu5m7absBxXxlfn1kLwfYKYT0MOyY!
> Sent
> branch=z9hG4bKf5s1psess0gbkeviMkQYREmK31pLWRKQ+FRmVzHQNG1Xv%8anzLVA!;extension=QKIT3jRNBcmZT7yu5m7absBxXxlfn1kLwfYKYT0MOyY!
> It another case, seems PJSIP has another scenario where the % character is processed as the escaped character if it would be printable character.  Example, received %4C.  The send replaces that portion with upper case L
> Received
> branch=z9hG4bKf5s1psess0gbkeviMkQYREmK31pLWRKQ+FRmVzHQNG1Xv%4CnzLVA!;extension=QKIT3jRNBcmZT7yu5m7absBxXxlfn1kLwfYKYT0MOyY!
> Sent
> branch=z9hG4bKf5s1psess0gbkeviMkQYREmK31pLWRKQ+FRmVzHQNG1XvLnzLVA!;extension=QKIT3jRNBcmZT7yu5m7absBxXxlfn1kLwfYKYT0MOyY!



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list