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:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    0 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 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