what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Apple WLC_E_COUNTRY_CODE_CHANGED Information Leak

Apple WLC_E_COUNTRY_CODE_CHANGED Information Leak
Posted Sep 22, 2017
Authored by Google Security Research, laginimaineb

Apple products suffers from an information leak when handling WLC_E_COUNTRY_CODE_CHANGED event packets.

tags | advisory
systems | apple
advisories | CVE-2017-7116
SHA-256 | d9fd260e76fa5bb413e17f4cda2ada7d5e896a778a13ebaf5b7d8bf3679a09e6

Apple WLC_E_COUNTRY_CODE_CHANGED Information Leak

Change Mirror Download
Apple: Information Leak when handling WLC_E_COUNTRY_CODE_CHANGED event packets 

CVE-2017-7116


Broadcom produces Wi-Fi HardMAC SoCs which are used to handle the PHY and MAC layer processing. These chips are present in both mobile devices and Wi-Fi routers, and are capable of handling many Wi-Fi related events without delegating to the host OS. On iOS, the "AppleBCMWLANBusInterfacePCIe" driver is used in order to handle the PCIe interface and low-level communication protocols with the Wi-Fi SoC (also referred to as "dongle"). Similarly, the "AppleBCMWLANCore" driver handles the high-level protocols and the Wi-Fi configuration.

When the dongle wishes to notify the host OS of an event, it does so by encoding a special "packet" and transmitting it to the host. These packets have an ether type of 0x886C, and do not contain actual packet data, but rather encapsulate information about events which must be handled by the driver.

One of the supported event packets is the WLC_E_COUNTRY_CODE_CHANGED message, which notifies that host that the country code has been modified. On iOS, these events are handled by the "handleCountryCodeChangedEvent" function in the "AppleBCMWLANCore" driver. Each packet of this type starts with the common event message header (which is 48 bytes long), followed by the 3-character country code, delimited by a NUL.

Here is a snippet of "handleCountryCodeChangedEvent"'s high-level logic:

int64_t handleCountryCodeChangedEvent(void* this, uint8_t* event_packet) {

char* country_code = (char*)this + 3244;
char* alt_country_code = (char*)this + 3248;
strncpy(country_code, event_packet + 48, 3);
country_code[3] = '\0';

if ( strncmp(country_code, "XZ", strlen("XZ")) &&
strncmp(alt_country_code, country_code 4)) {

strncpy(alt_country_code, country_code, 3);
alt_country_code[3] = '\0';
updateChannelSpecsAsync(this);

}
...
}

int64_t updateChannelSpecsAsync(void* this)
{
char request_buffer[0x1C2];
bzero(request_buffer, 0x1C2);
char* country_code = (char*)this + 3244;
strlcpy(request_buffer, country_code, 4);
return issueCommand(..., request_buffer, ...); //Getting the "chanspecs" IO-Var
...
}

As can be seen above, the function fails to verify that the length of the event message is sufficiently long (that is, larger than just the message header itself). As a result, an attacker controlling the dongle can send a WLC_E_COUNTRY_CODE_CHANGED event packet with no body payload. Doing so will cause the 3 bytes of the country code to be copied OOB (from event_packet + 48). As long as these bytes are not "XZ" or the previously stored country code ("alt_country_code"), "updateChannelSpecsAsync" will be called, causing the OOB data to be sent back to the dongle in the WLC_GET_VAR ioctl - thus leaking the bytes back to the dongle.

This bug is subject to a 90 day disclosure deadline. After 90 days elapse
or a patch has been made broadly available, the bug report will become
visible to the public.



Found by: laginimaineb

Login or Register to add favorites

File Archive:

July 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    27 Files
  • 2
    Jul 2nd
    10 Files
  • 3
    Jul 3rd
    35 Files
  • 4
    Jul 4th
    27 Files
  • 5
    Jul 5th
    18 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    25 Files
  • 12
    Jul 12th
    11 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    28 Files
  • 16
    Jul 16th
    6 Files
  • 17
    Jul 17th
    0 Files
  • 18
    Jul 18th
    0 Files
  • 19
    Jul 19th
    0 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    0 Files
  • 23
    Jul 23rd
    0 Files
  • 24
    Jul 24th
    0 Files
  • 25
    Jul 25th
    0 Files
  • 26
    Jul 26th
    0 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close