Repository navigation
test(mcp): values and comments in unexpected places are refused by the matching rule (#1231) - #1233
Merged
Merged
Conversation
…e matching rule (#1231) Statement-shape cases do not cover writes that hide inside comments, dollar quotes, a CTE or an executable comment. Each case now asserts the rule that refuses it, and a write keyword inside a string literal is checked to stay a value.
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.
Refs #1231
What was missing
The security suite covered statement shapes. Writes that hide where a shape check does not look were not covered: behind a comment, inside a dollar quote, in a CTE, in an executable MySQL comment, or in a row lock at the end of a read.
Changes
single_statement(a comment does not hide a separator; a dollar-quoted block does not either),data_modifying(a DELETE in a CTE),mysql_executable_comment, andselect_into_or_lock.Not in this PR
sql(table names are checked against the catalog already).Not verified locally
Tests were not run locally, per the project rule. The rule ids of the first five cases are the ones the guard tests in #1232 already exercise in CI.