Skip to content

[release/11.0] Read the cab signature from the correct reserved fields - #17367

Merged
akoeplinger merged 2 commits into
release/11.0from
backport/pr-17363-to-release/11.0
Aug 19, 2026
Merged

akoeplinger merged 2 commits into
release/11.0from
backport/pr-17363-to-release/11.0

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Backport of #17363 to release/11.0

/cc @akoeplinger @nohwnd

nohwnd and others added 2 commits August 19, 2026 12:21
The per-cabinet reserved area of a signed cabinet starts with a 4 byte
header, and the signature offset and size follow it. CabSecurityInfoProvider
read the offset and the size from the first two fields, so it took the
header as the offset and the real offset as the size. The bounds check then
failed and every signed cab was reported as unsigned.

Fix #17362

Co-authored-by: Copilot App <[email protected]>
BinaryWriter always writes little-endian but BitConverter.GetBytes uses the
machine endianness, so the test mixed the two. Cabinet fields are little-endian,
write them with BinaryPrimitives so the fixture is the same on every machine.

Also note why cbCabinet is the signature offset, it is the size of the cabinet
proper and signtool appends the signature after it. Both sample files agree.

Co-authored-by: Copilot App <[email protected]>
@akoeplinger
akoeplinger enabled auto-merge (squash) August 19, 2026 12:22
@akoeplinger
akoeplinger merged commit a4c4c88 into release/11.0 Aug 19, 2026
9 of 12 checks passed
@akoeplinger
akoeplinger deleted the backport/pr-17363-to-release/11.0 branch August 19, 2026 13:47
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc2 milestone Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants