Commit 4250323
committed
fix(xpkg): pin Fetch to the verified digest
The CachedClient.Get path was:
1. fetcher.Head(parsedResolvedRef) -> resolves tag -> digest D
2. validator.Validate(ref=D, vc) -> cosign verifies D
3. fetcher.Fetch(parsedResolvedRef) -> remote.Image(tag)
4. img.Manifest() (called by ExtractPackageYAML) -> GET tag again
Steps 1 and 4 hit the registry independently. A registry that serves
different content between the two requests can have step 2 verify a
benign signed digest while step 4 returns an unsigned malicious
manifest, and the consumer (Crossplane) installs the malicious package
despite the ImageConfig signature verification succeeding.
Pin the Fetch (and the validator call) to digestRef so the digest we
verify is the digest we pull.
Signed-off-by: tonghuaroot <tonghuaroot@gmail.com>1 parent d331401 commit 4250323
1 file changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
320 | 327 | | |
321 | | - | |
322 | | - | |
| 328 | + | |
323 | 329 | | |
324 | 330 | | |
325 | 331 | | |
326 | 332 | | |
327 | 333 | | |
328 | | - | |
| 334 | + | |
329 | 335 | | |
330 | 336 | | |
331 | 337 | | |
| |||
0 commit comments