Changeset: 529f462f73cc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/529f462f73cc
Added Files:
        sql/test/bugs/Tests/escaped-unicode.test
Modified Files:
        sql/test/bugs/Tests/All
Branch: Dec2025
Log Message:

Add test.


diffs (67 lines):

diff --git a/sql/test/bugs/Tests/All b/sql/test/bugs/Tests/All
--- a/sql/test/bugs/Tests/All
+++ b/sql/test/bugs/Tests/All
@@ -117,3 +117,4 @@ procedure-recompile
 rse_bug
 delete-or-not-in-bug
 default-error
+escaped-unicode
diff --git a/sql/test/bugs/Tests/escaped-unicode.test 
b/sql/test/bugs/Tests/escaped-unicode.test
new file mode 100644
--- /dev/null
+++ b/sql/test/bugs/Tests/escaped-unicode.test
@@ -0,0 +1,54 @@
+statement ok
+DROP TABLE IF EXISTS escapetest
+
+statement ok
+CREATE TABLE escapetest (abcdefg STRING)
+
+statement ok
+INSERT INTO escapetest
+
+statement ok
+VALUES ('one')
+
+statement ok
+INSERT INTO escapetest
+
+statement ok
+VALUES ('two')
+
+statement ok
+INSERT INTO escapetest
+
+statement ok
+VALUES ('a\'b''c')
+
+statement ok
+INSERT INTO escapetest
+
+statement ok
+VALUES ('a\\b''c\\\\')
+
+statement ok
+INSERT INTO escapetest
+
+statement ok
+VALUES ('a\\b''c\\\\d\\\'')
+
+-- not a backslash escape breakout.
+-- (returns 0 rows because "x" != "\e")
+query T nosort
+SELECT *
+  FROM escapetest
+ WHERE 'x' = '\e'' OR 1=1 -- '
+----
+
+-- SQL string escape (injection vector)
+-- return all rows, because while "x" != "\é"
+-- the backslash escape interacts with the non-ascii
+-- char in a way such that "''" is not handled properly.
+query T nosort
+SELECT *
+  FROM escapetest
+ WHERE 'x' = '\é'' OR 1=1 -- '
+----
+
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to