CWE Reference
CWE-107: Struts: Unused Validation Form
Official CWE-107 CWE context with Glexia analysis, remediation guidance, related CVEs, and ATT&CK context.
Release 4.20weaknessDraft
Glexia's Take
CWE-107: Struts: Unused Validation Form
Struts: Unused Validation Form represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.
Executive Impact
- Other: Quality Degradation
Developer Pattern
CWE-107 is the kind of defect developers can usually prevent with explicit validation, safer framework defaults, and tests that exercise hostile input or unsafe state transitions.
Confidence
high confidence from CWE-107, 4.20.
Official CWE Definition
CWE-107: Struts: Unused Validation Form
An unused validation form indicates that validation logic is not up-to-date.
Developer And Remediation Guidance
How teams prevent and detect this weakness
Causes
- In the following example the class RegistrationForm is a Struts framework ActionForm Bean that will maintain user input data from a registration webpage for an online business site. The user will enter registration data and, through the Struts framework, the RegistrationForm bean will maintain the user data in the form fields using the private member variables. The RegistrationForm class uses the Struts validation capability by extending the ValidatorForm class and including the validation for the form fields within the validator XML file, validator.xml. However, the validator XML file, validator.xml, for the RegistrationForm class includes the validation form for the user input form field "phone" that is no longer used by the input form and the RegistrationForm class. Any validation forms that are no longer required should be removed from the validator XML file, validator.xml.,The existence of unused forms may be an indication to attackers that this code is out of date or poorly maintained.
Remediation
- Implementation: Remove the unused Validation Form from the validation.xml file.
Detection
- Code review
- SAST
- DAST
- Focused regression tests
Mappings
Related CVEs, CWEs, and ATT&CK context
ATT&CK Relevance
ATT&CK relevance is shown only when reviewed or responsibly inferred.