SKumari871977 (Community Member) asked a question.

How to use query with a .jsp file passing the query from Text Area?

I have a scenario, where the sql is being taken from Text area in the jsp file, and some restrictions are made to use only select query.

 

<td align=left ><TEXTAREA name=“statement” rows="15" cols="100"><%=((statement==null)?"":statement)%></TEXTAREA></td>

<%

if ( statement != null && statement .length() > 0 )

{

// Validation to check if its a select statement or not

PreparedStatement ps = conn.prepareStatement(statement);

ResultSet rs = ps.executeQuery();

}

%>

 

Any idea or advice, how to mitigate this above scenario?


    • SKumari871977 (Community Member)

      Hi @Boy, Security Consultant (Veracode)​ 

      This is actually a admin accessible page, and we don't have the permissions to remove the functionality. Any other advice, how to mitigate the scenario?

       

Topics (3)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.