CWEweakness

CWE-102 Struts: Duplicate Validation Forms

Official page ↗
Abstraction
Variant
Structure
Simple
Status
Incomplete
Languages
Java
CWE version
5.0

Description

The product uses multiple Struts validation forms with the same name.

Common consequences

• Integrity: Unexpected State — If two validation forms have the same name, the Struts Validator arbitrarily chooses one of the forms to use for input validation and discards the other. This decision might not correspond to the programmer's expectations, possibly leading to resultant weaknesses. Moreover, it indicates that the validation logic is not up-to-date, and can indicate that other, more subtle validation errors are present.

Potential mitigations

• [Implementation] The DTD or schema validation will not catch the duplicate occurrence of the same form name. To find the issue in the implementation, manual checks or automated static analysis could be applied to the xml configuration files.

Detection methods

• Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Related

Child of · CWE (3)

  • CWE-1173 Improper Use of Validation Framework weakness
  • CWE-20 Improper Input Validation weakness
  • CWE-694 Use of Multiple Resources with Duplicate Identifier weakness

Referenced by CVE · weakness (1)

  • CVE-2022-20520 In onCreate of various files, there is a possible tapjacking/overlay attack. vulnerability

Referenced by CWE · peer of (1)

  • CWE-675 Multiple Operations on Resource in Single-Operation Context weakness