]> git.ipfire.org Git - thirdparty/openwrt.git/commit
hostapd: ucode: fix per-station PSK list parsing in sta_auth
authorFelix Fietkau <nbd@nbd.name>
Fri, 10 Jul 2026 11:58:10 +0000 (13:58 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 16 Jul 2026 09:50:21 +0000 (11:50 +0200)
commitf3ff33c8a91854d7beee075337c8816a48db16b3
tree9665872cc45b9c6e604a779b0f25802ab4dc9c30
parenteb5ccabf0edc0ed88b29c8d3cbea7effc3ecd285
hostapd: ucode: fix per-station PSK list parsing in sta_auth

Two defects handling the psk array returned by an auth handler: strlen()
ran before the string was validated (strlen(NULL) on a non-string entry),
and the hex-PMK branch tested the array length instead of the entry length.
A 64-character passphrase therefore reached the passphrase branch and its
memcpy of str_len + 1 overflowed passphrase[MAX_PASSPHRASE_LEN + 1] by one
byte. Validate the type first and branch on the string length.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/services/hostapd/src/src/ap/ucode.c