CWE-1474
Description
The product parses or transforms data into another format, structure, or representation, but the newly-produced data is not semantically equivalent to the original data.
Consequences
Mitigations
Validate the transformed data against what was expected to be produced. If the data is complex and free-form with some "special elements" in them, consider re-parsing the output to ensure that it matches expectations.
Detection
Examine inputs that will be saved or otherwise processed, then look at how they are produced in output. Analyze outputs that are expected to be (1) unchanged from the inputs, or (2) changed in a controlled way. Consider analyzing the data to extract key elements, such as e-mail addresses or domain names, to ensure that they are consistent with the original input.
Examine inputs that will be saved or otherwise processed, then look at how they are produced in output. Analyze outputs that are expected to be (1) unchanged from the inputs, or (2) changed in a controlled way. Consider analyzing the data to extract key elements, such as e-mail addresses or domain names, to ensure that they are consistent with the original input.