concept size in category security
appears as: size, size

This is an excerpt from Manning's book API Security Starter.
Last, there may be security vulnerabilities due to the implementation of the API. For example, failing to check the size of inputs to your API may allow an attacker to bring down your server by sending a very large input that consumes all available memory; a type of denial of service (DoS) attack.
Table 4.3 Contract for keeping track of cat names
Method Precondition requires Postcondition ensures nextCatNameMust contain something sizeis the same after call
nameis guaranteed to contain s (a sound)dequeueCatNameMust contain something sizeis one less after callqueueCatNamenameisn’tnullnamemust contain s (a sound)
nameisn’t in listsizeis one more after call

This is an excerpt from Manning's book Secure by Design.
The Billion Laughs attack is as simple as it is effective. The main idea is to exploit the expandability property of XML entities by defining recursive definitions that expand into a huge memory footprint. Listing 1.8 shows an example of the attack that’s defined by a small XML block, less than 1 KB in size. This allows the block to pass most validation checks that rely on size or length. When the XML is loaded by the parser,
lol9expands into 10lol8s, which then expands into 100lol7s, and so on. This finally results in a billionlolstrings that consume several gigabytes of memory.
Table 4.3 Contract for keeping track of cat names (view table figure)
Method Precondition requires Postcondition ensures nextCatNameMust contain something sizeis the same after call
nameis guaranteed to contain s (a sound)dequeueCatNameMust contain something sizeis one less after callqueueCatNamenameisn’tnullnamemust contain s (a sound)
nameisn’t in listsizeis one more after call