CWE
Home > CWE List > CWE- Individual Dictionary Definition (1.0.1)  
Search by ID:

CWE-102: Struts: Duplicate Validation Forms

Individual Definition in a New Window
Struts: Duplicate Validation Forms
Status: Incomplete
Weakness ID: 102 (Weakness Variant)
Description
Summary

The application uses multiple validation forms with the same name, which might cause the Struts Validator to validate a form that the programmer does not expect.

Extended Description

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.

Weakness Ordinalities
Primary (where the weakness exists independent of other weaknesses)
Causal Nature
Explicit (an explicit weakness resulting from behavior of the developer)
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.

Demonstrative Examples

Two validation forms with the same name.

<form-validation>
<formset>
<form name="ProjectForm"> ... </form>
<form name="ProjectForm"> ... </form>
</formset>
</form-validation>

It is critically important that validation logic be maintained and kept in sync with the rest of the application.

Other Notes

Unchecked input is the root cause of some of today's worst and most common software security problems. Cross-site scripting, SQL injection, and process control vulnerabilities can all stem from incomplete or absent input validation. Although J2EE applications are not generally susceptible to memory corruption attacks, if a J2EE application interfaces with native code that does not perform array bounds checking, an attacker may be able to use an input validation mistake in the J2EE application to launch a buffer overflow attack.

Relationships
NatureTypeIDNameView(s) this relationship pertains toView(s)
ChildOfCategoryCategory101Struts Validation Problems
Development Concepts (primary)699
ChildOfWeakness BaseWeakness BaseWeakness Base694Use of Multiple Resources with Duplicate Identifier
Research Concepts (primary)1000
ChildOfWeakness ClassWeakness ClassWeakness Class20Insufficient Input Validation
Seven Pernicious Kingdoms (primary)700
PeerOfWeakness ClassWeakness ClassWeakness Class675Duplicate Operations on Resource
Research Concepts1000
Taxonomy Mappings
Mapped Taxonomy NameMapped Node Name
7 Pernicious KingdomsStruts: Duplicate Validation Forms
Applicable Platforms
Languages
Java
Time of Introduction
* Implementation
Content History
Submissions
7 Pernicious Kingdoms. (Externally Mined)
Modifications
Eric Dalci. Cigital. 2008-07-01. (External)
updated Demonstrative_Example, Potential_Mitigations, Time_of_Introduction
CWE Content Team. MITRE. 2008-09-08. (Internal)
updated Relationships, Other_Notes, Taxonomy_Mappings, Weakness_Ordinalities
CWE Content Team. MITRE. 2008-10-14. (Internal)
updated Description, Other_Notes, Potential_Mitigations
Page Last Updated: October 16, 2008