[go: up one dir, main page]

Bug 937419 (CVE-2015-8041) - VUL-1: CVE-2015-8041: wpa_supplicant,hostapd: Incomplete WPS and P2P NFC NDEF record payload length validation
Summary: VUL-1: CVE-2015-8041: wpa_supplicant,hostapd: Incomplete WPS and P2P NFC NDEF...
Status: RESOLVED FIXED
Alias: CVE-2015-8041
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Ruediger Oertel
QA Contact: Security Team bot
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-08 16:20 UTC by Andreas Stieger
Modified: 2017-08-04 11:16 UTC (History)
3 users (show)

See Also:
Found By: Security Response Team
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
0001-NFC-Fix-payload-length-validation-in-NDEF-record-par.patch (2.35 KB, patch)
2015-07-08 16:20 UTC, Andreas Stieger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Stieger 2015-07-08 16:20:12 UTC
Created attachment 640395 [details]
0001-NFC-Fix-payload-length-validation-in-NDEF-record-par.patch

via oss-sec: http://seclists.org/oss-sec/2015/q3/65

Incomplete WPS and P2P NFC NDEF record payload length validation

Published: July 8, 2015
The latest version available from: http://w1.fi/security/2015-5/


Vulnerability

A vulnerability was found in NDEF record parsing implementation in
hostapd and wpa_supplicant. This code is used when an NFC Tag or NFC
connection handover is used to trigger WPS or P2P operations. The parser
did include bounds checking for the NDEF record payload length, but due
to insufficient integer size, it was possible to trigger integer
overflow that would result in bypassing the validation step with some
malformed NDEF records.

This could result in denial of service due to hostapd/wpa_supplicant
process termination (buffer read overflow) or infinite loop. The issue
can be triggered only if the NFC stack on the device does not perform
required validation steps for received NFC messages before sending the
received message to hostapd/wpa_supplicant for processing.

It was possible for the 32-bit record->total_length value to end up
wrapping around due to integer overflow if the longer form of payload
length field is used and record->payload_length gets a value close to
2^32. This could result in ndef_parse_record() accepting a too large
payload length value and the record type filter reading up to about 20
bytes beyond the end of the buffer and potentially killing the process.
This could also result in an attempt to allocate close to 2^32 bytes of
heap memory and if that were to succeed, a buffer read overflow of the
same length which would most likely result in the process termination.
In case of record->total_length ending up getting the value 0, there
would be no buffer read overflow, but record parsing would result in an
infinite loop in ndef_parse_records().

Any of these error cases could potentially be used for denial of service
attacks over NFC by using a malformed NDEF record on an NFC Tag or
sending them during NFC connection handover if the application providing
the NDEF message to hostapd/wpa_supplicant did no validation of the
received NDEF records. While such validation is likely done in the NFC
stack that needs to parse the NFC messages before further processing,
hostapd/wpa_supplicant should have (re)confirmed NDEF message validity
properly.


Vulnerable versions/configurations

hostapd v0.7.0-v2.4 with CONFIG_WPS_NFC=y in the build configuration
(hostapd/.config) and NFC NDEF records passed to hostapd by the NFC
stack without validation.

wpa_supplicant v0.7.0-v2.4 with CONFIG_WPS_NFC=y in the build
configuration (wpa_supplicant/.config) and NFC NDEF records passed to
wpa_supplicant by the NFC stack without validation.

Note: No NFC stack implementation has yet been identified with
capability to pass the malformed NDEF record to
hostapd/wpa_supplicant. As such, it is not known whether this issue can
be triggered in practice.

Alternatively to an actual NFC operation trigger, the malformed NDEF
records could be provided by other applications running on the same
device if access to the hostapd/wpa_supplicant control interface is
available to untrusted components or users.


Acknowledgments

Coverity Scan discovered parts of this issue (insecure data
handling/TAINTED_SCALAR) and was the trigger for further manual review
of the parsing routine.


Possible mitigation steps

- Merge the following commit and rebuild hostapd/wpa_supplicant:

  NFC: Fix payload length validation in NDEF record parser

  This patch is available from http://w1.fi/security/2015-5/

- Update to hostapd/wpa_supplicant v2.5 or newer, once available

- Remove CONFIG_WPS_NFC=y from build configuration

- Confirm that the NFC stack does sufficient validation of the received
  NDEF records before passing them to hostapd/wpa_supplicant
Comment 1 Swamp Workflow Management 2015-07-08 22:00:33 UTC
bugbot adjusting priority
Comment 2 Andreas Stieger 2015-07-09 09:35:24 UTC
SLE 12 wpa_supplicant 2.2 affected: CONFIG_WPS_NFC=y
Previous wpa_supplicant not affected, not configured

SLE does not ship hostapd

13.2 wpa_supplicant 2.2 affected: CONFIG_WPS_NFC=y
13.1 wpa_supplicant 2.0 not affected: #CONFIG_WPS_NFC=y

13.2 hostapd 2.1 affected: hostapd-2.1-defconfig.patch CONFIG_WPS_NFC=y
13.1 hostapd 2.0 affected: hostapd.diff CONFIG_WPS_NFC=y

DoS, and "No NFC stack implementation has yet been identified with
capability to pass the malformed NDEF record to hostapd/wpa_supplicant. As such, it is not known whether this issue can be triggered in practice."

--> VUL-1.
Comment 3 Andreas Stieger 2015-07-09 09:50:16 UTC
for completeness... openSUSE Tumbleweed is affected.
Comment 6 Ruediger Oertel 2015-10-27 10:43:17 UTC
Tumbleweed/Factory: new version (2.5) submitted including this fix
Comment 7 Bernhard Wiedemann 2015-10-27 11:00:09 UTC
This is an autogenerated message for OBS integration:
This bug (937419) was mentioned in
https://build.opensuse.org/request/show/341159 13.2 / wpa_supplicant
Comment 9 Bernhard Wiedemann 2015-10-27 12:01:55 UTC
This is an autogenerated message for OBS integration:
This bug (937419) was mentioned in
https://build.opensuse.org/request/show/341160 13.1 / wpa_supplicant
Comment 10 Sebastian Krahmer 2015-11-03 08:26:39 UTC
CVE-2015-8041
Comment 11 Swamp Workflow Management 2015-11-04 16:17:56 UTC
openSUSE-SU-2015:1912-1: An update that contains security fixes can now be installed.

Category: security (moderate)
Bug References: 937419
CVE References: 
Sources used:
openSUSE 13.2 (src):    wpa_supplicant-2.2-5.10.1
Comment 12 Swamp Workflow Management 2015-11-05 14:11:14 UTC
openSUSE-SU-2015:1920-1: An update that contains security fixes can now be installed.

Category: security (moderate)
Bug References: 937419
CVE References: 
Sources used:
openSUSE 13.1 (src):    wpa_supplicant-2.0-3.17.1
Comment 15 Swamp Workflow Management 2016-09-14 17:10:27 UTC
SUSE-SU-2016:2305-1: An update that fixes 5 vulnerabilities is now available.

Category: security (moderate)
Bug References: 930077,930078,930079,937419,952254
CVE References: CVE-2015-4141,CVE-2015-4142,CVE-2015-4143,CVE-2015-5310,CVE-2015-8041
Sources used:
SUSE Linux Enterprise Server 12-SP1 (src):    wpa_supplicant-2.2-14.2
SUSE Linux Enterprise Desktop 12-SP1 (src):    wpa_supplicant-2.2-14.2
Comment 16 Swamp Workflow Management 2016-09-23 14:12:22 UTC
openSUSE-SU-2016:2357-1: An update that fixes 5 vulnerabilities is now available.

Category: security (moderate)
Bug References: 930077,930078,930079,937419,952254
CVE References: CVE-2015-4141,CVE-2015-4142,CVE-2015-4143,CVE-2015-5310,CVE-2015-8041
Sources used:
openSUSE Leap 42.1 (src):    wpa_supplicant-2.2-8.1
Comment 17 Johannes Segitz 2017-08-04 11:16:52 UTC
fixed