Strip a UTF-8 byte-order mark before parsing a reward scaffold - #48
Merged
Conversation
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.
Found while verifying the published
v0.6.3wheel: a reward scaffold savedwith a UTF-8 byte-order mark — what a Windows editor produces by default — was
reported as unparseable.
CPython strips the BOM when it reads a source file, so that scaffold imports
normally. The static checker decoded the bytes and handed the leading
U+FEFFto
ast.parse, which rejected it.The direction is fail-closed: a legitimate file was refused, nothing unsafe was
accepted. So this is a robustness defect, not a security one — but it would
have made
bridge doctorunusable for anyone whose editor writes a BOM.v0.6.3is immutable and keeps the behaviour; this lands in0.6.4.Regressions
interface_shape_verifiedwith nofindings;
exploit()is still rejected withtop_level_call, still never executes, and still creates no marker file.The second one matters more than the first: the fix must not turn the BOM into
a way to slip past the checker.
Also recorded
pinned-profile-smokeis documented as deliberately excluded from therequired-status-check list.
verl-bridge.ymlfilters on paths, so it neverreports on a pull request that does not touch bridge code — requiring it
blocked the v0.6.4 state-sync PR permanently until it was removed. It still
runs, and must pass, wherever it is relevant.
Validation
1832 CPU tests pass (2 new), ruff / format / mypy clean.