SQLi: store a variable value without the leading '@', matching C - #3
Merged
Merged
Conversation
C's parse_var assigns the token value from after the '@' symbols, so the value is the name alone and the '@' count is kept separately. The port stored the '@' in the value, so the function fold that matches a variable named like PASSWORD/USER/... compared against "@password" and never fired, typing `@pasSword(` as a variable where C types it as a function. The fingerprints then diverged (`v(f(1` vs the blacklisted `f(f(1`). Assign the value from after the '@' and reconstruct the '@' prefix from `count` where the source form is printed (the token-file and folding test formatters), as C's print_var does. Found by the 2-hour fuzz campaign, about 2.8M executions in. A dedicated differential test pins it; full corpus stays at 0.
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.
The 2-hour differential fuzz campaign (added in the previous PR) found
this about 2.8M executions in, well beyond the per-pull-request smoke
test's reach. It is a false negative and the first divergence outside the
strchr-NUL family.The divergence
@pasSword(pasSword(2isf(f(1in C (a blacklisted pattern, so SQLi)but was
v(f(1in the port (benign). The function fold converts abareword or variable named
PASSWORD/USER/... followed by(into afunction. C's
parse_varstores the variable value from after the@(the name alone; the
@count is a separate field), so the fold comparespasSwordand fires. The port stored the@in the value, so it compared@pasSword, which never matched, and the variable kept its type.Fix
Assign the variable value from after the
@symbols, matching C. Theprinted source form is reconstructed from the
@count where it is needed(the token-file and folding test formatters), exactly as C's
print_vardoes. A dedicated differential test pins
@pasSword(.Gate
Full-corpus differential (162,963 inputs) stays at 0 on verdicts and
fingerprints. The nightly campaign continues from here.