Skip to content

Refactor/2026 02 query sanitizer#660

Merged
takapi327 merged 2 commits intoseries/0.6.xfrom
refactor/2026-02-QuerySanitizer
Feb 24, 2026
Merged

Refactor/2026 02 query sanitizer#660
takapi327 merged 2 commits intoseries/0.6.xfrom
refactor/2026-02-QuerySanitizer

Conversation

@takapi327
Copy link
Owner

@takapi327 takapi327 commented Feb 24, 2026

Implementation Details

QuerySanitizer.scala - Modification of Regular Expression Patterns:

Pattern Before After
STRING_LITERAL_PATTERN '(?:[^'\\]|\\.)*' '(?:[^'\\]|\\.|'')*'
DOUBLE_QUOTED_PATTERN "(?:[^"\\]|\\.)*" "(?:[^"\\]|\\.|"")*"
  • Correctly recognizes MySQL's '' escape method (e.g., 'It''s a test') as a single literal
  • Similarly supports the "" escape method (double-quote version)

QuerySanitizerTest.scala - Added 16 tests:

Category Number of tests Content
ReDoS Resistance Test 11 Confirmation of processing completion for malicious input against each regular expression pattern
MySQL '' Escape 3 Basic, multiple times, empty string cases
MAX_QUERY_LENGTH Boundary 2 Operation verification near the upper limit

Fixes

Fixes #xxxxx

Pull Request Checklist

  • Wrote unit and integration tests
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code formatting by scalafmt (sbt scalafmtAll command execution)
  • Add copyright headers to new files

References

@takapi327 takapi327 added this to the 0.6.0 milestone Feb 24, 2026
@takapi327 takapi327 self-assigned this Feb 24, 2026
@takapi327 takapi327 added 🔧 refactor Refactoring ldbc:connector Addition and modification of functionality to Connector projects labels Feb 24, 2026
@takapi327 takapi327 changed the base branch from master to series/0.6.x February 24, 2026 02:38
@takapi327 takapi327 mentioned this pull request Feb 24, 2026
13 tasks
@takapi327 takapi327 merged commit 684e75c into series/0.6.x Feb 24, 2026
47 of 55 checks passed
@takapi327 takapi327 deleted the refactor/2026-02-QuerySanitizer branch February 24, 2026 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ldbc:connector Addition and modification of functionality to Connector projects 🔧 refactor Refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant