Tag: data-integrity

Overflow when deserializing relational database objects

Deserializing objects from relational databases should allocate a 64-bit, not 32-bit, type for the auto-incremented identifier.

Missing check on the result of createNewFile

Missing check on the result of createNewFile might cause data loss.

Input and output values become out of sync

If a method that uses an input parameter to update an output value throws an exception, then the output value is not updated.

Override of reserved variable names in a Lambda function

Overriding environment variables that are reserved by AWS Lambda might lead to unexpected behavior.

Missing byte array length of JSON parser

Specify the length of the input byte array when creating a JSON parser to avoid a deserialization problem.

Avoid reset exception in Amazon S3

Uploading objects to Amazon S3 by using streams (either through an AmazonS3 client or TransferManager) might encounter network connectivity or timeout issues.

Missing S3 bucket owner condition

Not setting the S3 bucket owner condition might introduce a risk of accidentally using a wrong bucket.

Log injection

Using untrusted inputs in a log statement can enable attackers to break the log's format, forge log entries, and bypass log monitors.

Improper use of classes that aren't thread-safe

Improper use of thread-unsafe classes in multi-threaded programs can cause the programs to be unstable.

Improperly formatted string arguments

Format strings appropriately for their argument types. For example, use %d, not %s, for integers.

Case sensitive keys in S3 object user metadata

User metadata keys are case insensitive and are returned as lowercase strings, even if they were originally specified with uppercase strings.

Stack trace not included in re-thrown exception

When re-throwing an exception, make sure to include the stack trace.

Ignored output of DynamoDBMapper operations

Check if errors are returned by DynamoDBMapper's BatchWrite operations.

Catching and not re-throwing or logging exceptions

It's not good practice to catch an exception and then re-throw or log it.

Incorrect string equality operator

Use equals(), not ==, when checking if two strings are equal.

Missing pagination

Additional results are not checked for a paginated API call. This might produce inaccurate results.

Missing timezone of SimpleDateFormat

Using a SimpleDateFormat object without setting its timezone can result in unexpected date and time.

Missing handling of file deletion result

Unhandled failures of deleting files can exhaust file handles.

Batch request with unchecked failures

Not checking which items have failed can lead to loss of data.