Descrizione
In the Linux kernel, the following vulnerability has been resolved: netfilter: ebtables: terminate table name before find_table_lock() update_counters() and compat_update_counters() forward a user-supplied 32-byte table name to find_table_lock() without NUL-terminating it. On a lookup miss, find_inlist_lock() calls try_then_request_module(..., "%s%s", "ebtable_", name), and vsnprintf() reads past the name field and the stack object until it hits a zero byte. BUG: KASAN: stack-out-of-bounds in string (lib/vsprintf.c:648 lib/vsprintf.c:730) Read of size 1 at addr ffff8880119dfb20 by task exploit/147 Call Trace: ... string (lib/vsprintf.c:648 lib/vsprintf.c:730) vsnprintf (lib/vsprintf.c:2945) __request_module (kernel/module/kmod.c:150) do_update_counters.isra.0 (net/bridge/netfilter/ebtables.c:371 net/bridge/netfilter/ebtables.c:380) update_counters (net/bridge/netfilter/ebtables.c:1440) do_ebt_set_ctl (net/bridge/netfilter/ebtables.c:2573) nf_setsockopt (net/netfilter/nf_sockopt.c:101) ip_setsockopt (net/ipv4/ip_sockglue.c:1424) raw_setsockopt (net/ipv4/raw.c:847) __sys_setsockopt (net/socket.c:2393) ... compat_do_replace() shares the same unterminated name via compat_copy_ebt_replace_from_user(); terminate it there too so all find_table_lock() callers behave alike. The other callers already terminate the name after the copy.
Come correggere
Priorità: Media — correggere nel prossimo ciclo di patch. Motivazione: CVSS 7.1.
Versioni da aggiornare
- Linux Linux Kernel: vulnerabili le versioni dalla
2.6.12.1precedenti alla5.10.261→ aggiornare alla5.10.261o successiva. - Linux Linux Kernel: vulnerabili le versioni dalla
5.11precedenti alla5.15.212→ aggiornare alla5.15.212o successiva. - Linux Linux Kernel: vulnerabili le versioni dalla
5.16precedenti alla6.1.178→ aggiornare alla6.1.178o successiva. - Linux Linux Kernel: vulnerabili le versioni dalla
6.2precedenti alla6.6.145→ aggiornare alla6.6.145o successiva. - Linux Linux Kernel: vulnerabili le versioni dalla
6.7precedenti alla6.12.96→ aggiornare alla6.12.96o successiva. - Linux Linux Kernel: vulnerabili le versioni dalla
6.13precedenti alla6.18.39→ aggiornare alla6.18.39o successiva. - Linux Linux Kernel: vulnerabili le versioni dalla
6.19precedenti alla7.1.4→ aggiornare alla7.1.4o successiva. - Linux Linux Kernel: vulnerabile la versione
2.6.12→ installare l'ultima release supportata dal vendor. - Linux Linux Kernel: vulnerabile la versione
2.6.12 rc2→ installare l'ultima release supportata dal vendor. - Linux Linux Kernel: vulnerabile la versione
2.6.12 rc3→ installare l'ultima release supportata dal vendor. - Linux Linux Kernel: vulnerabile la versione
2.6.12 rc4→ installare l'ultima release supportata dal vendor. - Linux Linux Kernel: vulnerabile la versione
2.6.12 rc5→ installare l'ultima release supportata dal vendor. - Linux Linux Kernel: vulnerabile la versione
7.2 rc1→ installare l'ultima release supportata dal vendor. - Linux Linux Kernel: vulnerabile la versione
7.2 rc2→ installare l'ultima release supportata dal vendor.
Patch e advisory
- Patch: git.kernel.org/stable/c/2664f537ca5bcb2ef3fac2683dc…
- Patch: git.kernel.org/stable/c/4c046ca4e35a83ea32f6e748f54…
- Patch: git.kernel.org/stable/c/6fe8d3cecd20bfaaaf440db3a06…
- Patch: git.kernel.org/stable/c/7436da6c1bc44654b7f11a17e74…
- Patch: git.kernel.org/stable/c/a622d2e9608c9dff47fc2e5759a…
- Patch: git.kernel.org/stable/c/ab63ccefb9c71627f957a0724c2…
- Patch: git.kernel.org/stable/c/b6183b1b88a722b6d8ea0cecc99…
- Patch: git.kernel.org/stable/c/c6f539311e58e76aa96feef0f15…
Mitigazioni temporanee
Da applicare solo se non è possibile aggiornare subito:
- Ridurre la superficie esposta (disattivare servizi e funzionalità inutilizzati), mantenere attive le protezioni del sistema operativo (ASLR, DEP/NX) e segmentare la rete.
Verifica
- Individuare tutti gli asset con il prodotto interessato (inventario, scanner di vulnerabilità, CMDB).
- Confrontare la versione installata con quelle indicate sopra.
- Applicare l'aggiornamento in un ambiente di test, poi in produzione; riavviare i servizi se richiesto.
- Ripetere la scansione per confermare la correzione.
Configurazioni interessate
| Vendor | Prodotto | Versioni vulnerabili | Corretta in |
|---|---|---|---|
| Linux | Linux Kernel | ≥ 2.6.12.1 < 5.10.261 | 5.10.261 |
| Linux | Linux Kernel | ≥ 5.11 < 5.15.212 | 5.15.212 |
| Linux | Linux Kernel | ≥ 5.16 < 6.1.178 | 6.1.178 |
| Linux | Linux Kernel | ≥ 6.2 < 6.6.145 | 6.6.145 |
| Linux | Linux Kernel | ≥ 6.7 < 6.12.96 | 6.12.96 |
| Linux | Linux Kernel | ≥ 6.13 < 6.18.39 | 6.18.39 |
| Linux | Linux Kernel | ≥ 6.19 < 7.1.4 | 7.1.4 |
| Linux | Linux Kernel | 2.6.12 | — |
| Linux | Linux Kernel | 2.6.12 rc2 | — |
| Linux | Linux Kernel | 2.6.12 rc3 | — |
| Linux | Linux Kernel | 2.6.12 rc4 | — |
| Linux | Linux Kernel | 2.6.12 rc5 | — |
| Linux | Linux Kernel | 7.2 rc1 | — |
| Linux | Linux Kernel | 7.2 rc2 | — |
Riferimenti
- Patchhttps://git.kernel.org/stable/c/2664f537ca5bcb2ef3fac2683dcca602e51fad24
- Patchhttps://git.kernel.org/stable/c/4c046ca4e35a83ea32f6e748f54139f5fe2a1d01
- Patchhttps://git.kernel.org/stable/c/6fe8d3cecd20bfaaaf440db3a06ba674d2f2e322
- Patchhttps://git.kernel.org/stable/c/7436da6c1bc44654b7f11a17e746f6999fd37250
- Patchhttps://git.kernel.org/stable/c/a622d2e9608c9dff47fc2e5759ac7aa3a836b45d
- Patchhttps://git.kernel.org/stable/c/ab63ccefb9c71627f957a0724c2b9ebc869c6f20
- Patchhttps://git.kernel.org/stable/c/b6183b1b88a722b6d8ea0cecc99eba168a15e0be
- Patchhttps://git.kernel.org/stable/c/c6f539311e58e76aa96feef0f1572b13a564f8a2
- Riferimentohttps://cert-portal.siemens.com/productcert/html/ssa-019113.html
- Riferimentohttps://cert-portal.siemens.com/productcert/html/ssa-457936.html