Merge pull request #68 from CartoDB/fix_querytables
try to fix security problem
This commit is contained in:
commit
0d5a1c3e49
@ -16,9 +16,9 @@ BEGIN
|
||||
|
||||
FOR rec IN SELECT CDB_QueryStatements(query) q LOOP
|
||||
|
||||
IF NOT ( rec.q ilike 'select %' or rec.q ilike 'with %' ) THEN
|
||||
--RAISE WARNING 'Skipping %', rec.q;
|
||||
CONTINUE;
|
||||
IF NOT ( rec.q ilike 'select%' or rec.q ilike 'with%' ) THEN
|
||||
--RAISE WARNING 'Skipping %', rec.q;
|
||||
CONTINUE;
|
||||
END IF;
|
||||
|
||||
BEGIN
|
||||
|
@ -31,3 +31,7 @@ create table sc.test (a int);
|
||||
insert into sc.test values (1);
|
||||
WITH inp AS ( select 'select * from sc.test'::text as q )
|
||||
SELECT q, CDB_QueryTables(q) from inp;
|
||||
|
||||
WITH inp AS ( select 'SELECT
|
||||
* FROM geometry_columns'::text as q )
|
||||
SELECT q, CDB_QueryTables(q) from inp;
|
||||
|
@ -13,3 +13,5 @@ CREATE SCHEMA
|
||||
CREATE TABLE
|
||||
INSERT 0 1
|
||||
select * from sc.test|{sc.test}
|
||||
SELECT
|
||||
* FROM geometry_columns|{pg_catalog.pg_attribute,pg_catalog.pg_class,pg_catalog.pg_namespace,pg_catalog.pg_type}
|
||||
|
Loading…
Reference in New Issue
Block a user