В ядре Linux была устранена следующая уязвимость: wifi: mwifiex: привязывает шаг OUI по паре шифров к длине IE mwifiex_search_oui_in_ie() читает счет (PTK) по паре шифров из информационного элемента маяк/зонд-ответ RSN или WPA, а затем проходит столько же 4-байтовых OUIs, сравнивая каждый с memcmp(). Подсчет происходит непосредственно от (поставляемого атакующим) IE и никогда не проверяется по собственной длине элемента, и вызывающее лицо допускает элемент только на element_id (has_ieee_hdr() / has_vendor_hdr(), без проверки длины). Таким образом, созданный RSN/WPA IE с большим числом попарно считывает ход до 255 * 4 байтов мимо элемента - out-of-bounds считывает буфер маяка kmemdup()'d, доступный из любого AP, чей ответ маяка / зонда обрабатывается во время разбора результатов сканирования.
Передайте количество байтов IE, доступных в списке OUI, и привязывайте ход к элементу. Сохраняйте длину подписанной и отвергайте отрицательное значение перед любой незнаковой арифметикой, поэтому малая или нулевая длина IE не может перетекать в большую size_t и победить границу. Обнаружено 0sec автоматизированного инструментария исследования безопасности (https://0sec.ai).
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: wifi: mwifiex: bound the pairwise-cipher OUI walk to the IE length mwifiex_search_oui_in_ie() reads a pairwise-cipher (PTK) count from a beacon/probe-response RSN or WPA information element and then walks that many 4-byte OUIs, comparing each with memcmp(). The count comes straight from the (attacker-supplied) IE and is never checked against the element's own length, and the callers admit the element on element_id alone (has_ieee_hdr() / has_vendor_hdr(), no length check). A crafted RSN/WPA IE with a large pairwise count therefore makes the walk read up to 255 * 4 bytes past the element -- an out-of-bounds read of the kmemdup()'d beacon buffer, reachable from any AP whose beacon/probe response is processed during scan-result parsing. Pass the number of IE bytes available at the OUI list and bound the walk to the element. Keep the length signed and reject a negative value before any unsigned arithmetic, so a small or zero IE length cannot underflow to a large size_t and defeat the bound. Found by 0sec automated security-research tooling (https://0sec.ai).