fix: reject value substitution on non-sorry'd definitions - #86
Closed
savarin wants to merge 1 commit into
Closed
Conversation
Compare.loop's dependency walk accepts any constant whose type matches between challenge and solution, even when the value (body) differs. A submitter can exploit this by redefining a non-sorry'd definition to make a false challenge statement true in the solution. Guard the type-only fallback with hasSorryAxValue: only fire when the challenge-side value references sorryAx. Non-sorry definitions with mismatched values are now rejected. Reproducer: https://github.com/savarin/comparator-proof-bypass
Author
|
Closing — the vulnerability exists in a local patch, not in upstream master. The type-only fallback this fixes was introduced by our own elaboration-divergence patches, not by upstream code. Apologies for the noise. |
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.
Fixes: #85
Compare.loopaccepts any dependency whose type matches between challengeand solution, even when the value differs. This allows a submitter to
redefine a non-sorry'd definition to make a false challenge statement true.
Changes
hasSorryAxValue: checks whether aConstantInfo's value expressionreferences
sorryAxviagetUsedConstants.Compare.loop: when a constant's typematches but its value differs, accept only if the challenge-side value
references
sorryAx. Non-sorry definitions with mismatched values arerejected.
Test cases
Reproducer at https://github.com/savarin/comparator-proof-bypass:
test-1-type-mismatch: honest submission → PASS (unchanged)test-2-value-cheat: value substitution → FAIL (was PASS)test-3-sorry-tolerance: sorry'd definition → PASS (unchanged)