Commit 0ef5290
committed
admin: harden forwarded delete (NUL + slash) (Codex P2 ×2)
Two related findings on PR #635 / forward_server.go's
handleDelete:
- NUL-byte smuggling: handleDelete decoded with goccy/go-json
but skipped the explicit NUL scan that decodeCreateTableRequest
applies. Same vector as the #634 fix — `{"name":"users"}\x00{"extra":1}`
passes dec.More() because goccy treats NUL as end-of-input.
Add the same pre-decode NUL rejection.
- Slash-in-name divergence: the HTTP handleDelete and
handleDescribe both reject `/` in the table name with 404, but
the forwarded delete just passed body.Name straight through to
AdminDeleteTable. A forwarded call could therefore act on
slash-bearing tables that a leader-direct call would 404. Reject
symmetrically before invoking the source.
Tests: two new ForwardServer cases — NUL payload + slash name.
Both confirm the source is never invoked when the precondition
fails (defence in depth — an asymmetric stub source would still
make the test green if we only checked the response code).1 parent edf812e commit 0ef5290
2 files changed
Lines changed: 54 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
174 | 183 | | |
175 | 184 | | |
176 | 185 | | |
| |||
185 | 194 | | |
186 | 195 | | |
187 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
188 | 205 | | |
189 | 206 | | |
190 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
154 | 191 | | |
155 | 192 | | |
156 | 193 | | |
| |||
0 commit comments