CVE-2016-9938 - Improper Authorization

Severity

50%

Complexity

99%

Confidentiality

48%

An issue was discovered in Asterisk Open Source 11.x before 11.25.1, 13.x before 13.13.1, and 14.x before 14.2.1 and Certified Asterisk 11.x before 11.6-cert16 and 13.x before 13.8-cert4. The chan_sip channel driver has a liberal definition for whitespace when attempting to strip the content between a SIP header name and a colon character. Rather than following RFC 3261 and stripping only spaces and horizontal tabs, Asterisk treats any non-printable ASCII character as if it were whitespace. This means that headers such as Contact\x01: will be seen as a valid Contact header. This mostly does not pose a problem until Asterisk is placed in tandem with an authenticating SIP proxy. In such a case, a crafty combination of valid and invalid To headers can cause a proxy to allow an INVITE request into Asterisk without authentication since it believes the request is an in-dialog request. However, because of the bug described above, the request will look like an out-of-dialog request to Asterisk. Asterisk will then process the request as a new call. The result is that Asterisk can process calls from unvetted sources without any authentication. If you do not use a proxy for authentication, then this issue does not affect you. If your proxy is dialog-aware (meaning that the proxy keeps track of what dialogs are currently valid), then this issue does not affect you. If you use chan_pjsip instead of chan_sip, then this issue does not affect you.

An issue was discovered in Asterisk Open Source 11.x before 11.25.1, 13.x before 13.13.1, and 14.x before 14.2.1 and Certified Asterisk 11.x before 11.6-cert16 and 13.x before 13.8-cert4. The chan_sip channel driver has a liberal definition for whitespace when attempting to strip the content between a SIP header name and a colon character. Rather than following RFC 3261 and stripping only spaces and horizontal tabs, Asterisk treats any non-printable ASCII character as if it were whitespace. This means that headers such as Contact\x01: will be seen as a valid Contact header. This mostly does not pose a problem until Asterisk is placed in tandem with an authenticating SIP proxy. In such a case, a crafty combination of valid and invalid To headers can cause a proxy to allow an INVITE request into Asterisk without authentication since it believes the request is an in-dialog request. However, because of the bug described above, the request will look like an out-of-dialog request to Asterisk. Asterisk will then process the request as a new call. The result is that Asterisk can process calls from unvetted sources without any authentication. If you do not use a proxy for authentication, then this issue does not affect you. If your proxy is dialog-aware (meaning that the proxy keeps track of what dialogs are currently valid), then this issue does not affect you. If you use chan_pjsip instead of chan_sip, then this issue does not affect you.

CVSS 3.0 Base Score 5.3. CVSS Attack Vector: network. CVSS Attack Complexity: low. CVSS Vector: (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N).

CVSS 2.0 Base Score 5. CVSS Attack Vector: network. CVSS Attack Complexity: low. CVSS Vector: (AV:N/AC:L/Au:N/C:N/I:P/A:N).

Demo Examples

Improper Authorization

CWE-285

This function runs an arbitrary SQL query on a given database, returning the result of the query.


               
$employeeRecord = runEmployeeQuery('EmployeeDB',$_GET['EmployeeName']);
return $preparedStatement->fetchAll();//Use a prepared statement to avoid CWE-89
/.../

While this code is careful to avoid SQL Injection, the function does not confirm the user sending the query is authorized to do so. An attacker may be able to obtain sensitive employee information from the database.

Improper Authorization

CWE-285

The following program could be part of a bulletin board system that allows users to send private messages to each other. This program intends to authenticate the user before deciding whether a private message should be displayed. Assume that LookupMessageObject() ensures that the $id argument is numeric, constructs a filename based on that id, and reads the message details from that file. Also assume that the program stores all private messages for all users in the same directory.


               
DisplayPrivateMessage($id);
print "Body: " . encodeHTML($Message->{body}) . "\n";
# For purposes of this example, assume that CWE-309 and# CWE-523 do not apply.
ExitError("invalid username or password");

While the program properly exits if authentication fails, it does not ensure that the message is addressed to the user. As a result, an authenticated attacker could provide any arbitrary identifier and read private messages that were intended for other users.

One way to avoid this problem would be to ensure that the "to" field in the message object matches the username of the authenticated user.

Overview

Type

Digium

First reported 8 years ago

2016-12-12 21:59:00

Last updated 7 years ago

2017-07-27 01:29:00

Affected Software

Digium Asterisk 11.0.0

11.0.0

Digium Asterisk 11.0.0 beta1

11.0.0

Digium Asterisk 11.0.0 beta2

11.0.0

Digium Asterisk 11.0.0 release candidate 1

11.0.0

Digium Asterisk 11.0.0 release candidate 2

11.0.0

Digium Asterisk 11.0.1

11.0.1

Digium Asterisk 11.0.2

11.0.2

Digium Asterisk 11.1.0

11.1.0

Digium Asterisk 11.1.0 release candidate 1

11.1.0

Digium Asterisk 11.1.0 release candidate 3

11.1.0

Digium Asterisk 11.1.1

11.1.1

Digium Asterisk 11.1.2

11.1.2

Digium Asterisk 11.2.0

11.2.0

Digium Asterisk 11.2.0 release candidate 1

11.2.0

Digium Asterisk 11.2.1

11.2.1

Digium Asterisk 11.2.2

11.2.2

Digium Asterisk 11.3.0

11.3.0

Digium Asterisk 11.4.0

11.4.0

Digium Asterisk 11.5.0

11.5.0

Digium Asterisk 11.5.1

11.5.1

Digium Asterisk 11.6.0

11.6.0

Digium Asterisk 11.6.1

11.6.1

Digium Asterisk 11.7.0

11.7.0

Digium Asterisk 11.8.0

11.8.0

Digium Asterisk 11.8.1

11.8.1

Digium Asterisk 11.9.0

11.9.0

Digium Asterisk 11.10.0

11.10.0

Digium Asterisk 11.10.1

11.10.1

Digium Asterisk 11.10.2

11.10.2

Digium Asterisk 11.11.0

11.11.0

Digium Asterisk 11.12.0

11.12.0

Digium Asterisk 11.12.1

11.12.1

Digium Asterisk 11.13.0

11.13.0

Digium Asterisk 11.13.1

11.13.1

Digium Asterisk 11.14.0

11.14.0

Digium Asterisk 11.14.1

11.14.1

Digium Asterisk 11.14.2

11.14.2

Digium Asterisk 11.15.0

11.15.0

Digium Asterisk 11.15.1

11.15.1

Digium Asterisk 11.16.0

11.16.0

Digium Asterisk 11.17.0

11.17.0

Digium Asterisk 11.17.1

11.17.1

Digium Asterisk 11.18.0

11.18.0

Digium Asterisk 11.19.0

11.19.0

Digium Asterisk 11.20.0

11.20.0

Digium Asterisk 11.21.0

11.21.0

Digium Asterisk 11.21.1

11.21.1

Digium Asterisk 11.21.2

11.21.2

Digium Asterisk 11.22.0

11.22.0

Digium Asterisk 11.22.0 Release Candidate 1

11.22.0

Digium Asterisk 11.23.0

11.23.0

Digium Asterisk 11.23.0 Release Candidate 1

11.23.0

Digium Asterisk 11.23.1

11.23.1

Digium Asterisk 11.24.0

11.24.0

Digium Asterisk 11.24.1

11.24.1

Digium Asterisk 11.25.0

11.25.0

Digium Asterisk 13.0.0

13.0.0

Digium Asterisk 13.0.0 Beta 1

13.0.0

Digium Asterisk 13.0.0 Beta 2

13.0.0

Digium Asterisk 13.0.0 Beta 3

13.0.0

Digium Asterisk 13.0.1

13.0.1

Digium Asterisk 13.0.2

13.0.2

Digium Asterisk 13.1.0

13.1.0

Digium Asterisk 13.1.1

13.1.1

Digium Asterisk 13.2.0

13.2.0

Digium Asterisk 13.2.1

13.2.1

Digium Asterisk 13.3.0

13.3.0

Digium Asterisk 13.3.1

13.3.1

Digium Asterisk 13.3.2

13.3.2

Digium Asterisk 13.4.0

13.4.0

Digium Asterisk 13.5.0

13.5.0

Digium Asterisk 13.6.0

13.6.0

Digium Asterisk 13.7.0

13.7.0

Digium Asterisk 13.7.1

13.7.1

Digium Asterisk 13.7.2

13.7.2

Digium Asterisk 13.8.0

13.8.0

Digium Asterisk 13.8.0 Release Candidate 1

13.8.0

Digium Asterisk 13.8.1

13.8.1

Digium Asterisk 13.8.2

13.8.2

Digium Asterisk 13.9.0

13.9.0

Digium Asterisk 13.9.1

13.9.1

Digium Asterisk 13.10.0

13.10.0

Digium Asterisk 13.10.0 Release Candidate 1

13.10.0

Digium Asterisk 13.11.0

13.11.0

Digium Asterisk 13.11.1

13.11.1

Digium Asterisk 13.11.2

13.11.2

Digium Asterisk 13.12.0

13.12.0

Digium Asterisk 13.12.1

13.12.1

Digium Asterisk 13.12.2

13.12.2

Digium Asterisk 13.13.0

13.13.0

Digium Asterisk 14.0.0

14.0.0

Digium Asterisk 14.0.0 Beta 1

14.0.0

Digium Asterisk 14.0.0 Beta 2

14.0.0

Digium Asterisk 14.0.0 Release Candidate 1

14.0.0

Digium Asterisk 14.0.0 Release Candidate 2

14.0.0

Digium Asterisk 14.0.1

14.0.1

Digium Asterisk 14.0.2

14.0.2

Digium Asterisk 14.1.0

14.1.0

Digium Asterisk 14.1.1

14.1.1

Digium Asterisk 14.1.2

14.1.2

Digium Asterisk 14.2.0

14.2.0

Digium Certified Asterisk 11.0.0

11.0.0

Digium Certified Asterisk 11.0.0 Release Candidate 1

11.0.0

Digium Certified Asterisk 11.0.0 Release Candidate 2

11.0.0

Digium Certified Asterisk 11.1.0

11.1.0

Digium Certified Asterisk 11.1.0 Release Candidate 1

11.1.0

Digium Certified Asterisk 11.1.0 Release Candidate 2

11.1.0

Digium Certified Asterisk 11.1.0 Release Candidate 3

11.1.0

Digium Certified Asterisk 11.3.0

11.3.0

Digium Certified Asterisk 11.3.0 Release Candidate 1

11.3.0

Digium Certified Asterisk 11.3.0 Release Candidate 2

11.3.0

Digium Certified Asterisk 11.4.0

11.4.0

Digium Certified Asterisk 11.4.0 Release Candidate 1

11.4.0

Digium Certified Asterisk 11.4.0 Release Candidate 2

11.4.0

Digium Certified Asterisk 11.4.0 Release Candidate 3

11.4.0

Digium Certified Asterisk 11.5.0

11.5.0

Digium Certified Asterisk 11.5.0 Release Candidate 1

11.5.0

Digium Certified Asterisk 11.5.0 Release Candidate 2

11.5.0

Digium Certified Asterisk 11.6-cert1

11.6

Digium Certified Asterisk 11.6 cert 1 LTS

11.6

Digium Certified Asterisk 11.6 Cert12 Long Term Support

11.6

Digium Certified Asterisk 11.6 Cert13 Long Term Support

11.6

Digium Certified Asterisk 11.6 Cert14 Long Term Support

11.6

Digium Certified Asterisk 11.6 Cert15 Long Term Support

11.6

Digium Certified Asterisk 11.6-cert1 release candidate 1

11.6

Digium Certified Asterisk 11.6-cert1 release candidate 2

11.6

Digium Certified Asterisk 11.6-cert2

11.6

Digium Certified Asterisk 11.6 cert 2 LTS

11.6

Digium Certified Asterisk 11.6-cert3

11.6

Digium Certified Asterisk 11.6 cert 3 LTS

11.6

Digium Certified Asterisk 11.6 cert 4 LTS

11.6

Digium Certified Asterisk 11.6 cert 5 LTS

11.6

Digium Certified Asterisk 11.6 cert 6 LTS

11.6

Digium Certified Asterisk 11.6 cert 7 LTS

11.6

Digium Certified Asterisk 11.6 cert8 LTS

11.6

Digium Certified Asterisk 11.6.0 LTS

11.6.0

Digium Certified Asterisk 11.6.0

11.6.0

Digium Certified Asterisk 11.6.0 release candidate 1

11.6.0

Digium Certified Asterisk 11.6.0 release candidate 2

11.6.0

Stay updated

ExploitPedia is constantly evolving. Sign up to receive a notification when we release additional functionality.

Get in touch

If you'd like to report a bug or have any suggestions for improvements then please do get in touch with us using this form. We will get back to you as soon as we can.