Validate and retain DebugInfo from untrusted packages - #3460
Open
huitseeker wants to merge 33 commits into
Open
Conversation
huitseeker
force-pushed
the
debug-info-hostile-wire-tdd
branch
from
August 4, 2026 14:08
436f30b to
de8161b
Compare
huitseeker
force-pushed
the
debug-info-hostile-wire-tdd
branch
from
August 4, 2026 14:15
de8161b to
0790fdd
Compare
huitseeker
marked this pull request as ready for review
August 4, 2026 14:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Package::read_from_bytes()used to discardDEBUG_INFOfrom untrusted.maspfiles. It now keeps valid debug data and rejects the whole package when that data is unsafe.This matters for any tool or service that accepts full
.maspfiles. Fuzzed packages reached the debug decoder, public lookup methods, error reporting, wire round trips, and embedded kernel extraction.Trusted readers still check the MAST forest but may wait to check debug data until
Package::debug_info(). Unchecked readers still skip MAST checks and remain limited to bytes that the same trusted system checked before.Security impact
u32::MAX, and arrays whose padded size is too large or overflows.Performance
Times are paired Criterion estimates against
origin/nexton the same host.The untrusted debug path now does work that the old code skipped, so its 126.95% increase is not a
like-for-like regression. The matching read-plus-decode path changed by 4.17% (95% interval:
+3.99% to +4.37%), below the 5% limit. Packages without debug data changed by less than 0.4%.
Unblocks #3418.