ID

VAR-201703-1161


CVE

CVE-2017-6957


TITLE

Broadcom Wi-Fi HardMAC SoC Chip firmware stack-based buffer overflow vulnerability

Trust: 0.8

sources: JVNDB: JVNDB-2017-002752

DESCRIPTION

Stack-based buffer overflow in the firmware in Broadcom Wi-Fi HardMAC SoC chips, when the firmware supports CCKM Fast and Secure Roaming and the feature is enabled in RAM, allows remote attackers to execute arbitrary code via a crafted reassociation response frame with a Cisco IE (156). Broadcom BCM4339 SoC is prone to a stack-based buffer-overflow vulnerability because it fails to perform adequate boundary checks on user-supplied data. Attackers can exploit this issue to run arbitrary code within the context of the affected application. Failed exploit attempts may result in denial-of-service conditions. BCM4339 6.37.34.40 is vulnerable; other versions may also be vulnerable. Broadcom: Stack buffer overflow when parsing CCKM reassociation response CVE-2017-6957 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. In order to allow fast roaming between access points in a wireless network, the Broadcom firmware supports Cisco's "CCKM Fast and Secure Roaming" feature, allowing a client to roam to a new AP quickly. Note this is a different implementation to IEEE 802.11r-2008 FT. When a client decides to roam to a different AP in a CCKM network, they first send a reassociation request to the AP containing a Cisco-specific information element. This AP responds by sending a reassociation response frame also containing a Cisco-specific IE (156). This IE is then parsed by the firmware in order to make sure it is valid, before completing the reassociation process. A packet capture containing this process can be found here: <a href="https://mrncciew.files.wordpress.com/2014/09/7921-cckm-roaming-to-lap1.zip" title="" class="" rel="nofollow">https://mrncciew.files.wordpress.com/2014/09/7921-cckm-roaming-to-lap1.zip</a> On the BCM4339 SoC with firmware version 6.37.34.40 the reassociation response in handled by ROM function 0x78D04. This function first retrieves the Cisco-specific IE. Then, it proceeds to check that the IE is valid, by calling function 0x794F8. This function performs four validations: 1. Bytes [2:4] of the IE match Cisco's OUI (00-40-96) 2. Byte 5 of the IE is zero 3. (IE[20] | (IE[21] << 8)) + 30 == IE[1] + 2 (where IE[1] is the IE's length field) 4. Bytes [6:9] of the IE match bytes [14:17] of the IE in the reassociation request (see packet capture) If the IE passes the checks described above, the function proceeds to call ROM function 0x79390. This function unpacks data from the IE, and has approximately the following high-level logic: 1. void function_79390(void* unk, char* ie, char* buf) { 2. char buffer[128]; 3. memcpy(buffer, ..., 6); buffer += 6; 4. 5. memcpy(buffer, ie + 6, 4); buffer += 4; 6. *buffer = ie[10]; buffer += 1; 7. *buffer = ie[11]; buffer += 1; 8. memcpy(buffer, ie + 12, 8); buffer += 8; 9. memcpy(buffer, ie + 20, 2); buffer += 2; 10. memcpy(buffer, ie + 30, ie[20] | (ie[21] << 8)); 11. 12. } As can be seen above, line 10 performs a memcpy into the stack-allocated buffer ("buffer"), using the value "ie[20] | (ie[21] << 8)" as the length field. However, as we've previously seen, the only validation performed on these two bytes is that: (ie[20] | (ie[21] << 8)) + 30 == ie[1] + 2 This means an attacker could craft a reassociation response frame containing a Cisco IE (156) as follows: 1. IE[2:4] = 0x00 0x40 0x96 2. IE[5] = 0 3. IE[20] | (IE[21] << 8) = 227 4. IE[1] = 255 5. IE[6:9] = REQIE[14:17] This IE satisfies all the constraints validated by function 0x794F8. However, when the IE is the passed into function 0x79390, it will cause memcpy operation at line 10 in the code above to exceed the buffer's bounds, trigger a stack buffer overflow with attacker controlled data. It should be noted that there is no stack cookie mitigation in the BCM4339 firmware, meaning an attacker would not require an additional vulnerability primitive in order to gain code execution using this vulnerability. I've verified this vulnerability statically on the BCM4339 chip with firmware version 6.37.34.40 (as present on the Nexus 5). However, I believe this vulnerability's scope includes a wider range of Broadcom SoCs and versions. This bug is subject to a 90 day disclosure deadline. If 90 days elapse without a broadly available patch, then the bug report will automatically become visible to the public. Found by: laginimaineb

Trust: 2.07

sources: NVD: CVE-2017-6957 // JVNDB: JVNDB-2017-002752 // BID: 97054 // VULHUB: VHN-115160 // PACKETSTORM: 141803

AFFECTED PRODUCTS

vendor:broadcommodel:bcm4339 socscope:eqversion:6.37.34.40

Trust: 1.6

vendor:broadcommodel:bcm4339 socscope: - version: -

Trust: 0.8

vendor:broadcommodel:bcm4339scope:eqversion:6.37.34.40

Trust: 0.3

sources: BID: 97054 // JVNDB: JVNDB-2017-002752 // CNNVD: CNNVD-201703-1167 // NVD: CVE-2017-6957

CVSS

SEVERITY

CVSSV2

CVSSV3

nvd@nist.gov: CVE-2017-6957
value: HIGH

Trust: 1.0

NVD: CVE-2017-6957
value: HIGH

Trust: 0.8

CNNVD: CNNVD-201703-1167
value: MEDIUM

Trust: 0.6

VULHUB: VHN-115160
value: MEDIUM

Trust: 0.1

nvd@nist.gov: CVE-2017-6957
severity: MEDIUM
baseScore: 6.8
vectorString: AV:N/AC:M/AU:N/C:P/I:P/A:P
accessVector: NETWORK
accessComplexity: MEDIUM
authentication: NONE
confidentialityImpact: PARTIAL
integrityImpact: PARTIAL
availabilityImpact: PARTIAL
exploitabilityScore: 8.6
impactScore: 6.4
acInsufInfo: NONE
obtainAllPrivilege: NONE
obtainUserPrivilege: NONE
obtainOtherPrivilege: NONE
userInteractionRequired: NONE
version: 2.0

Trust: 1.8

VULHUB: VHN-115160
severity: MEDIUM
baseScore: 6.8
vectorString: AV:N/AC:M/AU:N/C:P/I:P/A:P
accessVector: NETWORK
accessComplexity: MEDIUM
authentication: NONE
confidentialityImpact: PARTIAL
integrityImpact: PARTIAL
availabilityImpact: PARTIAL
exploitabilityScore: 8.6
impactScore: 6.4
acInsufInfo: NONE
obtainAllPrivilege: NONE
obtainUserPrivilege: NONE
obtainOtherPrivilege: NONE
userInteractionRequired: NONE
version: 2.0

Trust: 0.1

nvd@nist.gov: CVE-2017-6957
baseSeverity: HIGH
baseScore: 8.1
vectorString: CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
attackVector: NETWORK
attackComplexity: HIGH
privilegesRequired: NONE
userInteraction: NONE
scope: UNCHANGED
confidentialityImpact: HIGH
integrityImpact: HIGH
availabilityImpact: HIGH
exploitabilityScore: 2.2
impactScore: 5.9
version: 3.0

Trust: 1.8

sources: VULHUB: VHN-115160 // JVNDB: JVNDB-2017-002752 // CNNVD: CNNVD-201703-1167 // NVD: CVE-2017-6957

PROBLEMTYPE DATA

problemtype:CWE-119

Trust: 1.9

sources: VULHUB: VHN-115160 // JVNDB: JVNDB-2017-002752 // NVD: CVE-2017-6957

THREAT TYPE

remote

Trust: 0.6

sources: CNNVD: CNNVD-201703-1167

TYPE

buffer overflow

Trust: 0.6

sources: CNNVD: CNNVD-201703-1167

CONFIGURATIONS

sources: JVNDB: JVNDB-2017-002752

PATCH

title:Top Pageurl:https://jp.broadcom.com/

Trust: 0.8

title:Issue 1051url:https://bugs.chromium.org/p/project-zero/issues/detail?id=1051

Trust: 0.8

sources: JVNDB: JVNDB-2017-002752

EXTERNAL IDS

db:NVDid:CVE-2017-6957

Trust: 2.9

db:BIDid:97054

Trust: 2.8

db:PACKETSTORMid:141803

Trust: 1.8

db:JVNDBid:JVNDB-2017-002752

Trust: 0.8

db:CNNVDid:CNNVD-201703-1167

Trust: 0.7

db:SEEBUGid:SSVID-92838

Trust: 0.1

db:VULHUBid:VHN-115160

Trust: 0.1

sources: VULHUB: VHN-115160 // BID: 97054 // JVNDB: JVNDB-2017-002752 // PACKETSTORM: 141803 // CNNVD: CNNVD-201703-1167 // NVD: CVE-2017-6957

REFERENCES

url:http://www.securityfocus.com/bid/97054

Trust: 2.5

url:http://packetstormsecurity.com/files/141803/broadcom-stack-buffer-overflow.html

Trust: 1.7

url:https://bugs.chromium.org/p/project-zero/issues/detail?id=1051

Trust: 1.7

url:https://nvd.nist.gov/vuln/detail/cve-2017-6957

Trust: 0.9

url:http://cve.mitre.org/cgi-bin/cvename.cgi?name=cve-2017-6957

Trust: 0.8

url:http://www.broadcom.com/

Trust: 0.3

url:https://mrncciew.files.wordpress.com/2014/09/7921-cckm-roaming-to-lap1.zip</a>

Trust: 0.1

url:https://mrncciew.files.wordpress.com/2014/09/7921-cckm-roaming-to-lap1.zip"

Trust: 0.1

sources: VULHUB: VHN-115160 // BID: 97054 // JVNDB: JVNDB-2017-002752 // PACKETSTORM: 141803 // CNNVD: CNNVD-201703-1167 // NVD: CVE-2017-6957

CREDITS

laginimaineb

Trust: 0.9

sources: BID: 97054 // CNNVD: CNNVD-201703-1167

SOURCES

db:VULHUBid:VHN-115160
db:BIDid:97054
db:JVNDBid:JVNDB-2017-002752
db:PACKETSTORMid:141803
db:CNNVDid:CNNVD-201703-1167
db:NVDid:CVE-2017-6957

LAST UPDATE DATE

2024-11-23T23:12:32.498000+00:00


SOURCES UPDATE DATE

db:VULHUBid:VHN-115160date:2017-03-31T00:00:00
db:BIDid:97054date:2017-03-29T00:01:00
db:JVNDBid:JVNDB-2017-002752date:2017-04-27T00:00:00
db:CNNVDid:CNNVD-201703-1167date:2017-03-29T00:00:00
db:NVDid:CVE-2017-6957date:2024-11-21T03:30:51.663

SOURCES RELEASE DATE

db:VULHUBid:VHN-115160date:2017-03-27T00:00:00
db:BIDid:97054date:2017-03-23T00:00:00
db:JVNDBid:JVNDB-2017-002752date:2017-04-27T00:00:00
db:PACKETSTORMid:141803date:2017-03-23T22:22:22
db:CNNVDid:CNNVD-201703-1167date:2017-03-28T00:00:00
db:NVDid:CVE-2017-6957date:2017-03-27T14:59:00.227