[SAST] SQL_Injection in the ClusterGremlinConnector file
Destination | ||
---|---|---|
File | entitlements/provider/entitlements-v2-azure/src/main/java/org/opengroup/osdu/entitlements/v2/azure/spi/gremlin/connection/ClusterGremlinConnector.java | |
Line number | 102 | |
Object | getResultList | |
Code line | return getResultList(client.submit(query)); |
Description
The application's submitTraversalAsQueryString method executes an SQL query with getResultList, at line 102 of \entitlements\provider\entitlements-v2-azure\src\main\java\org\opengroup\osdu\entitlements\v2\azure\spi\gremlin\connection\ClusterGremlinConnector.java. The application constructs this SQL query by embedding an untrusted string into the query without proper sanitization. The concatenated string is submitted to the database, where it is parsed and executed accordingly.An attacker would be able to inject arbitrary syntax and data into the SQL query, by crafting a malicious payload and providing it via the input groupEmail; this input is then read by the listGroupMembers method at line 58 of \entitlements\entitlements-v2-core\src\main\java\org\opengroup\osdu\entitlements\v2\api\ListMemberApi.java. This input then flows through the code, into a query and to the database server - without sanitization.This may enable an SQL Injection attack.