{"action":"opened","issue":{"url":"https://api.github.com/repos/hortonworks/registry/issues/481","repository_url":"https://api.github.com/repos/hortonworks/registry","labels_url":"https://api.github.com/repos/hortonworks/registry/issues/481/labels{/name}","comments_url":"https://api.github.com/repos/hortonworks/registry/issues/481/comments","events_url":"https://api.github.com/repos/hortonworks/registry/issues/481/events","html_url":"https://github.com/hortonworks/registry/issues/481","id":351823253,"node_id":"MDU6SXNzdWUzNTE4MjMyNTM=","number":481,"title":"Error because of SQL injection in search APIs.","user":{"login":"satishd","id":2577761,"node_id":"MDQ6VXNlcjI1Nzc3NjE=","avatar_url":"https://avatars1.githubusercontent.com/u/2577761?v=4","gravatar_id":"","url":"https://api.github.com/users/satishd","html_url":"https://github.com/satishd","followers_url":"https://api.github.com/users/satishd/followers","following_url":"https://api.github.com/users/satishd/following{/other_user}","gists_url":"https://api.github.com/users/satishd/gists{/gist_id}","starred_url":"https://api.github.com/users/satishd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/satishd/subscriptions","organizations_url":"https://api.github.com/users/satishd/orgs","repos_url":"https://api.github.com/users/satishd/repos","events_url":"https://api.github.com/users/satishd/events{/privacy}","received_events_url":"https://api.github.com/users/satishd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-18T14:08:03Z","updated_at":"2018-08-18T14:08:03Z","closed_at":null,"author_association":"COLLABORATOR","body":"the parameter name in the endpoint /api/v1/schemaregistry/search/schemas/aggregated is vulnerable to SQL injections, it throws below error when /api/v1/schemaregistry/search/schemas/aggregated?_orderByFields=timestamp,d&name=a'b is invoked.\r\n\r\n```\r\n! Causing: com.hortonworks.registries.storage.exception.StorageException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'b%' OR `description` LIKE '%null%'  ORDER BY `timestamp` DESC' at line 1\r\n! at com.hortonworks.registries.storage.impl.jdbc.provider.sql.factory.AbstractQueryExecutor$QueryExecution.executeQuery(AbstractQueryExecutor.java:343)\r\n! at com.hortonworks.registries.storage.impl.jdbc.provider.sql.factory.AbstractQueryExecutor.executeQuery(AbstractQueryExecutor.java:322)\r\n! at com.hortonworks.registries.storage.impl.jdbc.provider.mysql.factory.MySqlExecutor.select(MySqlExecutor.java:97)\r\n! at com.hortonworks.registries.storage.impl.jdbc.JdbcStorageManager.search(JdbcStorageManager.java:141)\r\n! at com.hortonworks.registries.schemaregistry.DefaultSchemaRegistry.searchSchemas(DefaultSchemaRegistry.java:854)\r\n! at com.hortonworks.registries.schemaregistry.webservice.SchemaRegistryResource.findSchemaMetadataInfos(SchemaRegistryResource.java:253)\r\n! at com.hortonworks.registries.schemaregistry.webservice.SchemaRegistryResource.findAggregatedSchemas(SchemaRegistryResource.java:294)\r\n! at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n! at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n! at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n! at java.lang.reflect.Method.invoke(Method.java:498)\r\n\r\n```"}}
{"actor":{"display_login":"satishd"}}