Details
-
Type:
Security
-
Status: Closed
-
Severity:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 13.38.0, 13.38.1, 16.15.0, 16.15.1, 17.9.0, 17.9.1, 18.1.0, 18.1.1
-
Component/s: pjproject/pjsip
-
Security Level: None
-
Regression:No
-
PJSIP Bundled:Yes
Description
Every time Asterisk/chan_pjsip transmits a "181 Call is being forwarded" packet, res_pjsip_diversion adds a "histinfo" element to Supported header. It doesn't check if "histinfo" has already been added, nor it performs a bounds check, thus making it possible to overwrite/corrupt memory past the PJSIP_GENERIC_ARRAY_MAX_COUNT elements that pjsip_supported_hdr can contain.
How to reproduce
Make a call from a pjsip endpoint to this diaplan:
exten => 181,1,NoOp
same => n,Set(i=9000)
same => n,While($[ ${DEC(i)} != 0])
same => n,Set(REDIRECTING(from-num)=${i})
same => n,EndWhile
How to crash Asterisk remotely
Use Dial application on an unanswered incoming PJSIP channel to connect to a channel indicating AST_CONTROL_REDIRECTING more than PJSIP_GENERIC_ARRAY_MAX_COUNT times (32 by default).
Example:
- 2 PJSIP endpoints [alice] and [bob]
- PJSIP/alice-00000001 executes Dial(PJSIP/bob)
- PJSIP/bob-00000002 sends an INVITE to bob
- bob sends 100 Trying, followed by repeating "181 Call Is Being Forwarded"
- Asterisk transmits 181 Call Is Being Forwarded to alice, adding one more "histinfo" element to Supported, eventually overwriting memory past array boundary until Asterisk crashes.
Issue Links
- is a clone of
-
SWP-11339 Loading...
Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.
A good first step is for you to review the Asterisk Issue Guidelines if you haven't already. The guidelines detail what is expected from an Asterisk issue report.
Then, if you are submitting a patch, please review the Patch Contribution Process.
Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.
Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at https://www.asterisk.org/terms-of-use/.