what you don't know can hurt you


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
MD5 | 18dfa8691803d310aeb0e9d26cfe8d89


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


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';


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


RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

March 2020

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

Top Authors In Last 30 Days

File Tags


packet storm

© 2016 Packet Storm. All rights reserved.

Security Services
Hosting By