Description
If a form bean does not extend an ActionForm subclass of the Validator framework, it can expose the application to other weaknesses related to insufficient input validation.
Potential Impact
Other
Other
Confidentiality, Integrity, Availability, Other
Other
Demonstrative Examples
public class RegistrationForm extends org.apache.struts.action.ActionForm {
// private variables for registration formprivate String name;private String email;...
public RegistrationForm() {super();}
// getter and setter methods for private variables...
}public class RegistrationForm extends org.apache.struts.validator.ValidatorForm {
// private variables for registration formprivate String name;private String email;...
public RegistrationForm() {super();}
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {...}
// getter and setter methods for private variables...
}Mitigations & Prevention
Ensure that all forms extend one of the Validation Classes.
Detection Methods
- Automated Static Analysis High — 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 sea
Related Weaknesses
Taxonomy Mappings
- 7 Pernicious Kingdoms: — Struts: Form Bean Does Not Extend Validation Class
- Software Fault Patterns: SFP24 — Tainted input to command
Frequently Asked Questions
What is CWE-104?
CWE-104 (Struts: Form Bean Does Not Extend Validation Class) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Variant-level weakness. If a form bean does not extend an ActionForm subclass of the Validator framework, it can expose the application to other weaknesses related to insufficient input validation.
How can CWE-104 be exploited?
Attackers can exploit CWE-104 (Struts: Form Bean Does Not Extend Validation Class) to other. This weakness is typically introduced during the Implementation phase of software development.
How do I prevent CWE-104?
Key mitigations include: Ensure that all forms extend one of the Validation Classes.
What is the severity of CWE-104?
CWE-104 is classified as a Variant-level weakness (Low-Medium abstraction). Its actual severity depends on the specific context and how the weakness manifests in your application.