Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ public void doPost(HttpServletRequest request, HttpServletResponse response)

String bar = doSomething(request, param);

// Validate input to prevent SQL injection - only allow alphanumeric and underscores
if (!bar.matches("^[a-zA-Z0-9_]+$")) {
response.getWriter().println("Error: Invalid stored procedure name.");
return;
}

String sql = "{call " + bar + "}";

try {
Expand Down