Commit 74a5252
committed
fix(svc): add bounds check before memcpy/strncpy in dump_pool_info handler
When processing isc_info_svc_dump_pool_info, the SPB clumplet's
declared length (length2) comes from the network and is only validated
against the destination buffer (fname). However, the source pointer
(items) is not checked against the SPB buffer end (end_items/end_items2).
An attacker with service API access can craft an SPB where the clumplet
length claims more data than the remaining buffer, causing memcpy or
strncpy to read past the SPB buffer boundary.
Add bounds checks in both Service::query() and Service::query2() to
set length2 to zero when the declared length would exceed the buffer.1 parent f0b0d0c commit 74a5252
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1257 | 1257 | | |
1258 | 1258 | | |
1259 | 1259 | | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
1260 | 1264 | | |
1261 | 1265 | | |
1262 | 1266 | | |
| |||
1711 | 1715 | | |
1712 | 1716 | | |
1713 | 1717 | | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
1714 | 1722 | | |
1715 | 1723 | | |
1716 | 1724 | | |
| |||
0 commit comments