Denial of Service Case 2:
Scenario: For showing list of Clients with pagination (max 10 per page).
def list = {
if(!params.max) params.max = 10
[clientList: Client.list(params)]
}
Possible Attack: Changing the max value to 100000000 in the request
Result: Query result loads 100000000 client data and again occurs an out of memory error
Possible Solutions in Groovy and Grails:
def list = {
params.max = Math.min( params.max?.toInteger() ?: 0, 100)
[clientList: Client.list(params)]
}
at worst case it will load just 100 records.
Reference: The Definite Guide to Grails, 2nd Edition
Posted by Md. Shahjalal 
