254
similar items that may exist at higher and lower levels of abstraction. In addition, relationships such
as PeerOf and CanAlsoBe are defined to show similar weaknesses that may want to be explored.
Relevant to the view "Research Concepts" (CWE-1000)
Nature Type ID Name Page
ChildOf 1173 Improper Use of Validation Framework 1969
Relevant to the view "Seven Pernicious Kingdoms" (CWE-700)
Nature Type ID Name Page
ChildOf 20 Improper Input Validation 20
Weakness Ordinalities
Primary :
Applicable Platforms
Language : Java (Prevalence = Undetermined)
Common Consequences
Scope Impact Likelihood
Integrity Unexpected State
Integrity Bypass Protection Mechanism
If unused fields are not validated, shared business logic
in an action may allow attackers to bypass the validation
checks that are performed for other uses of the form.
Potential Mitigations
Phase: Implementation
Validate all form fields. If a field is unused, it is still important to constrain it so that it is empty or
undefined.
Demonstrative Examples
Example 1:
In the following example the Java 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.
Example Language: (Result)
public class RegistrationForm extends org.apache.struts.validator.ValidatorForm {
// private variables for registration form
private String name;
private String address;
private String city;
private String state;
private String zipcode;
private String phone;
private String email;
public RegistrationForm() {
super();
}
// getter and setter methods for private variables
...
}
CWE Version 4.14
CWE-105: Struts: Form Field Without Validator
CWE-105: Struts: Form Field Without Validator