I was looking at different ways to secure .Net RESTful Web API When I came across this OWASP link.
One of the recommendation under Input Validation:
- Validate input: length / range / format and type
I start thinking about adding a constraint to all string attributes in view models. But, one of the requirement from customers is to have no limit for string lengths.
To face this trade-off, I need to figure out a number (string length maximum) that could be:
- Secure: does not make Web APIs fail or make backend code run out of memory.
- Unlimited: looks like unlimited string to end user.
I know that there is no such a thing "unlimited string", but I'm really looking for number here that is commonly used by developers in such a scenario.