Struts: Duplicate Validation Forms

Incomplete Variant
Structure: Simple
Description

This vulnerability occurs when an application defines multiple Struts validation forms with identical names. The framework then unpredictably selects only one form for validation, potentially bypassing intended security checks.

Extended Description

When duplicate validation form names exist, the Struts Validator picks one form arbitrarily and ignores the others. This can lead to the application validating user input against the wrong set of rules, creating unexpected security gaps. Developers might assume their defined validation is active, while in reality, a different—and possibly weaker—set of rules is being applied. This situation often signals outdated or inconsistent validation logic within the codebase. It serves as a clear indicator that the validation configuration is not being properly managed, which frequently accompanies other, more subtle flaws in input handling and data sanitization processes.

Common Consequences 1
Scope: Integrity

Impact: Unexpected State

Potential Mitigations 1
Phase: 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.
Demonstrative Examples 1

ID : DX-221

These two Struts validation forms have the same name.

Code Example:

Bad
XML
xml
It is not certain which form will be used by Struts. It is critically important that validation logic be maintained and kept in sync with the rest of the product.
References 1
Seven Pernicious Kingdoms: A Taxonomy of Software Security Errors
Katrina Tsipenyuk, Brian Chess, and Gary McGraw
NIST Workshop on Software Security Assurance Tools Techniques and MetricsNIST
07-11-2005
ID: REF-6
Applicable Platforms
Languages:
Java : Undetermined
Modes of Introduction
Implementation
Taxonomy Mapping
  • 7 Pernicious Kingdoms
  • Software Fault Patterns