Skip to content
This repository has been archived by the owner on Jan 23, 2021. It is now read-only.

Uploading following dataset gives unauthorized query #302

Closed
jdeck88 opened this issue Sep 21, 2018 · 2 comments
Closed

Uploading following dataset gives unauthorized query #302

jdeck88 opened this issue Sep 21, 2018 · 2 comments

Comments

@jdeck88
Copy link
Collaborator

jdeck88 commented Sep 21, 2018

Using the test user notification project,
Select "Replace Data"
Select blue cloud upload button next to the "Drop your files here to upload"
Select the attached file.

It processes and eventually returns the following message:
Amphibian_Disease_Panama_dataSmall.xlsx

{"status":false,"error":"UNAUTHORIZED_QUERY_TYPE","query_type":"ifexists(\nselect1\nfrominformation_schema.tables\nwhere\n)drop","args_provided":{"action":"upload","sql_query":"SUYgRVhJU1RTICgKICAgIFNFTEVDVCAxCiAgICBGUk9NIGluZm9ybWF0aW9uX3NjaGVtYS50YWJsZXMKICAgIFdIRVJFIHRhYmxlX25hbWUgPSAndDRkNGFhZjU5M2ZlNDI5NGJlZTA1NGMwN2MzNmU2Yzk1X2JhNDNkZWE0YzE3MDE0MjVlZmI2NzUyN2Q3NmIwYzdmOTEyMmEzMWInCikgRFJPUCBUQUJMRSB0NGQ0YWFmNTkzZmU0Mjk0YmVlMDU0YzA3YzM2ZTZjOTVfYmE0M2RlYTRjMTcwMTQyNWVmYjY3NTI3ZDc2YjBjN2Y5MTIyYTMxYjtDUkVBVEUgVEFCTEUgdDRkNGFhZjU5M2ZlNDI5NGJlZTA1NGMwN2MzNmU2Yzk1X2JhNDNkZWE0YzE3MDE0MjVlZmI2NzUyN2Q3NmIwYzdmOTEyMmEzMWIgIChpZCBpbnQsQ29sbGVjdG9yIHZhcmNoYXIsY29vcmRpbmF0ZVVuY2VydGFpbnR5SW5NZXRlcnMgZGVjaW1hbCxkZWNpbWFsTGF0aXR1ZGUgZGVjaW1hbCxkZWNpbWFsTG9uZ2l0dWRlIGRlY2ltYWwsZGF0ZUlkZW50aWZpZWQgZGF0ZSxzcGVjaWZpY0VwaXRoZXQgdmFyY2hhcixnZW51c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FuYW1hJyxudWxsLCd7IkNvbnRhY3ROYW1lIjoiQWxsaWUgQnlybmUiLCJiYXNpc09mUmVjb3JkIjoiTGl2aW5nU3BlY2ltZW4iLCJsYWJOdW1iZXIiOiIxMjExMTJfMDgiLCJDb2xsZWN0b3IyIjpudWxsLCJDb2xsZWN0b3IzIjpudWxsLCJ2ZXJiYXRpbUxvY2FsaXR5IjoiQWx0b3MgZGUgUGllZHJhIiwiSGFiaXRhdCI6bnVsbCwiVGVzdF9NZXRob2QiOiJxdWFudGl0YXRpdmUgUENSIiwiZXZlbnRSZW1hcmtzIjpudWxsLCJxdWFudGl0eURldGVjdGVkIjpudWxsLCJkaWx1dGlvbkZhY3RvciI6bnVsbCwiY3ljbGVUaW1lRmlyc3REZXRlY3Rpb24iOm51bGx9JywnJywnU2FjaGF0YW1pYSBhbGJvbWFjdWxhdGEnLFNUX1NldFNSSUQoU1RfUG9pbnQoLTgxLjEyMTg4MjQsOC41MTM3NjMyKSw0MzI2KSk7U0VMRUNUIGNkYl9jYXJ0b2RiZnl0YWJsZSgndDRkNGFhZjU5M2ZlNDI5NGJlZTA1NGMwN2MzNmU2Yzk1X2JhNDNkZWE0YzE3MDE0MjVlZmI2NzUyN2Q3NmIwYzdmOTEyMmEzMWInKTs="},"statement_context":{"statements_count":4,"statement_parsed":"IF EXISTS (\n SELECT 1\n FROM information_schema.tables\n WHERE table_name = 't4d4aaf593fe4294bee054c07c36e6c95_ba43dea4c1701425efb67527d76b0c7f9122a31b'\n) DROP TABLE t4d4aaf593fe4294bee054c07c36e6c95_ba43dea4c1701425efb67527d76b0c7f9122a31b;CREATE TABLE t4d4aaf593fe4294bee054c07c36e6c95_ba43dea4c1701425efb67527d76b0c7f9122a31b (id int,Collector varchar,coordinateUncertaintyInMeters decimal,decimalLatitude decimal,decimalLongitude decimal,dateIdentified date,specificEpithet varchar,genus varchar,fatal boolean,diseaseDetected varchar,sampleMethod varchar,diseaseTested varchar,sampleID text,diseaseLineage text,genotypeMethod text,sequenceURI text,lifeStage varchar,sex varchar,alt decimal,diagnosticLab text,fieldNumber text,ZEscore text,month text,day text,year text,country text,state_province text,fimsExtra json,infraspecificEpithet varchar,originalTaxa varchar,the_geom geometry","effective_key":1,"action_exists":false,"allowed_actions":{"0":"select","1":"delete","2":"insert","3":"insertinto","4":"update","5":"create"},"statement_number":0,"statements":{"0":"IF EXISTS (\n SELECT 1\n FROM information_schema.tables\n WHERE table_name = 't4d4aaf593fe4294bee054c07c36e6c95_ba43dea4c1701425efb67527d76b0c7f9122a31b'\n) DROP TABLE t4d4aaf593fe4294bee054c07c36e6c95_ba43dea4c1701425efb67527d76b0c7f9122a31b;CREATE TABLE t4d4aaf593fe4294bee054c07c36e6c95_ba43dea4c1701425efb67527d76b0c7f9122a31b (id int,Collector varchar,coordinateUncertaintyInMeters decimal,decimalLatitude decimal,decimalLongitude decimal,dateIdentified date,specificEpithet varchar,genus varchar,fatal boolean,diseaseDetected varchar,sampleMethod varchar,diseaseTested varchar,sampleID text,diseaseLineage text,genotypeMethod text,sequenceURI text,lifeStage varchar,sex varchar,alt decimal,diagnosticLab text,fieldNumber text,ZEscore text,month text,day text,year text,country text,state_province text,fimsExtra json,infraspecificEpithet varchar,originalTaxa varchar,the_geom geometry","1":" INSERT INTO t4d4aaf593fe4294bee054c07c36e6c95_ba43dea4c1701425efb67527d76b0c7f9122a31b VALUES (1,'Jamie Voyles',30,8.5137632,-81.1218824,'2012-11-12','albomaculata','Sachatamia',false,false,false,'Bd','121112_04',null,null,null,null,null,null,null,null,0,'11','12',2012,'Panama',null,'{"ContactName":"Allie Byrne","basisOfRecord":"LivingSpecimen","labNumber":"121112_04","Collector2":null,"Collector3":null,"verbatimLocality":"Altos de Piedra","Habitat":null,"Test_Method":"quantitative PCR","eventRemarks":null,"quantityDetected":null,"dilutionFactor":null,"cycleTimeFirstDetection":null}','','Sachatamia albomaculata',ST_SetSRID(ST_Point(-81.1218824,8.5137632),4326)), (2,'Jamie Voyles',30,8.5137632,-81.1218824,'2012-11-12','albomaculata','Sachatamia',false,false,false,'Bd','121112_06',null,null,null,null,null,null,null,null,0,'11','12',2012,'Panama',null,'{"ContactName":"Allie Byrne","basisOfRecord":"LivingSpecimen","labNumber":"121112_06","Collector2":null,"Collector3":null,"verbatimLocality":"Altos de Piedra","Habitat":null,"Test_Method":"quantitative PCR","eventRemarks":null,"quantityDetected":null,"dilutionFactor":null,"cycleTimeFirstDetection":null}','','Sachatamia albomaculata',ST_SetSRID(ST_Point(-81.1218824,8.5137632),4326)), (3,'Jamie Voyles',30,8.5137632,-81.1218824,'2012-11-12','albomaculata','Sachatamia',false,false,false,'Bd','121112_07',null,null,null,null,null,null,null,null,0,'11','12',2012,'Panama',null,'{"ContactName":"Allie Byrne","basisOfRecord":"LivingSpecimen","labNumber":"121112_07","Collector2":null,"Collector3":null,"verbatimLocality":"Altos de Piedra","Habitat":null,"Test_Method":"quantitative PCR","eventRemarks":null,"quantityDetected":null,"dilutionFactor":null,"cycleTimeFirstDetection":null}','','Sachatamia albomaculata',ST_SetSRID(ST_Point(-81.1218824,8.5137632),4326)), (4,'Jamie Voyles',30,8.5137632,-81.1218824,'2012-11-12','albomaculata','Sachatamia',false,false,false,'Bd','121112_08',null,null,null,null,null,null,null,null,0,'11','12',2012,'Panama',null,'{"ContactName":"Allie Byrne","basisOfRecord":"LivingSpecimen","labNumber":"121112_08","Collector2":null,"Collector3":null,"verbatimLocality":"Altos de Piedra","Habitat":null,"Test_Method":"quantitative PCR","eventRemarks":null,"quantityDetected":null,"dilutionFactor":null,"cycleTimeFirstDetection":null}','','Sachatamia albomaculata',ST_SetSRID(ST_Point(-81.1218824,8.5137632),4326)","2":"SELECT cdb_cartodbfytable('t4d4aaf593fe4294bee054c07c36e6c95_ba43dea4c1701425efb67527d76b0c7f9122a31b'","3":""}},"read_query":"IF EXISTS (\n SELECT 1\n FROM information_schema.tables\n WHERE table_name = 't4d4aaf593fe4294bee054c07c36e6c95_ba43dea4c1701425efb67527d76b0c7f9122a31b'\n) DROP TABLE t4d4aaf593fe4294bee054c07c36e6c95_ba43dea4c1701425efb67527d76b0c7f9122a31b;CREATE TABLE t4d4aaf593fe4294bee054c07c36e6c95_ba43dea4c1701425efb67527d76b0c7f9122a31b (id int,Collector varchar,coordinateUncertaintyInMeters decimal,decimalLatitude decimal,decimalLongitude decimal,dateIdentified date,specificEpithet varchar,genus varchar,fatal boolean,diseaseDetected varchar,sampleMethod varchar,diseaseTested varchar,sampleID text,diseaseLineage text,genotypeMethod text,sequenceURI text,lifeStage varchar,sex varchar,alt decimal,diagnosticLab text,fieldNumber text,ZEscore text,month text,day text,year text,country text,state_province text,fimsExtra json,infraspecificEpithet varchar,originalTaxa varchar,the_geom geometry); INSERT INTO t4d4aaf593fe4294bee054c07c36e6c95_ba43dea4c1701425efb67527d76b0c7f9122a31b VALUES (1,'Jamie Voyles',30,8.5137632,-81.1218824,'2012-11-12','albomaculata','Sachatamia',false,false,false,'Bd','121112_04',null,null,null,null,null,null,null,null,0,'11','12',2012,'Panama',null,'{"ContactName":"Allie Byrne","basisOfRecord":"LivingSpecimen","labNumber":"121112_04","Collector2":null,"Collector3":null,"verbatimLocality":"Altos de Piedra","Habitat":null,"Test_Method":"quantitative PCR","eventRemarks":null,"quantityDetected":null,"dilutionFactor":null,"cycleTimeFirstDetection":null}','','Sachatamia albomaculata',ST_SetSRID(ST_Point(-81.1218824,8.5137632),4326)), (2,'Jamie Voyles',30,8.5137632,-81.1218824,'2012-11-12','albomaculata','Sachatamia',false,false,false,'Bd','121112_06',null,null,null,null,null,null,null,null,0,'11','12',2012,'Panama',null,'{"ContactName":"Allie Byrne","basisOfRecord":"LivingSpecimen","labNumber":"121112_06","Collector2":null,"Collector3":null,"verbatimLocality":"Altos de Piedra","Habitat":null,"Test_Method":"quantitative PCR","eventRemarks":null,"quantityDetected":null,"dilutionFactor":null,"cycleTimeFirstDetection":null}','','Sachatamia albomaculata',ST_SetSRID(ST_Point(-81.1218824,8.5137632),4326)), (3,'Jamie Voyles',30,8.5137632,-81.1218824,'2012-11-12','albomaculata','Sachatamia',false,false,false,'Bd','121112_07',null,null,null,null,null,null,null,null,0,'11','12',2012,'Panama',null,'{"ContactName":"Allie Byrne","basisOfRecord":"LivingSpecimen","labNumber":"121112_07","Collector2":null,"Collector3":null,"verbatimLocality":"Altos de Piedra","Habitat":null,"Test_Method":"quantitative PCR","eventRemarks":null,"quantityDetected":null,"dilutionFactor":null,"cycleTimeFirstDetection":null}','','Sachatamia albomaculata',ST_SetSRID(ST_Point(-81.1218824,8.5137632),4326)), (4,'Jamie Voyles',30,8.5137632,-81.1218824,'2012-11-12','albomaculata','Sachatamia',false,false,false,'Bd','121112_08',null,null,null,null,null,null,null,null,0,'11','12',2012,'Panama',null,'{"ContactName":"Allie Byrne","basisOfRecord":"LivingSpecimen","labNumber":"121112_08","Collector2":null,"Collector3":null,"verbatimLocality":"Altos de Piedra","Habitat":null,"Test_Method":"quantitative PCR","eventRemarks":null,"quantityDetected":null,"dilutionFactor":null,"cycleTimeFirstDetection":null}','','Sachatamia albomaculata',ST_SetSRID(ST_Point(-81.1218824,8.5137632),4326));SELECT cdb_cartodbfytable('t4d4aaf593fe4294bee054c07c36e6c95_ba43dea4c1701425efb67527d76b0c7f9122a31b');","execution_time":0.35190582275391}

tigerhawkvok added a commit that referenced this issue Sep 21, 2018
@tigerhawkvok
Copy link
Contributor

Right. This hit the security layer to prevent malicious queries.

PR #304 includes possible fix 3ea2bdd

@tigerhawkvok
Copy link
Contributor

Fixed by PR #305

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants