Commit 57549bf
sumdb: ignore unrelated hashes in Lookup
During Lookup, if the server returns a validly signed record for an
unrelated module which contains in the signed tree head another hash
for the module which was requested in the "extension" portion of the
signed tree head (anything following the tree hash, but before the
signatures), _only_ the unrelated hashes are validated by checking the
relevant tiles, ignoring the portion in the tree head.
Lookup would then look for hash lines which match the requested module
path in the fully returned record, not just the validated portion,
causing only the hash appended to the tree head portion to be returned.
This would allow a malicious sumdb instance to return a validly signed
response for a module from which Lookup would return a hash which is not
actually present in the tree. This would allow a conspiring malicious
sumdb and module proxy (or a module proxy which is proxying the sumdb
_and has the sumdb key_) to serve malicious module content which is not
recorded in the transparency log.
The fix is quite simple, instead of caching the full record, we only
cache the hash lines returned by tlog.ParseRecord, which are validated.
Lookup will then only extract matching hashes from the validated
portion, instead of the full record.
Thanks to Mundur (https://github.com/M0nd0R) for reporting this issue.
Fixes CVE-2026-56864
Fixes golang/go#80745
Change-Id: I4a418620e8e4e8ab5f7ec41b0ed443a92e9be6e1
Reviewed-on: https://go-review.googlesource.com/c/mod/+/815000
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
Reviewed-by: Neal Patel <nealpatel@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>1 parent 96f62ae commit 57549bf
2 files changed
Lines changed: 50 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
| 277 | + | |
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
192 | 241 | | |
193 | 242 | | |
194 | 243 | | |
| |||
0 commit comments