Description
When an application does not use an input validation framework such as the Struts Validator, there is a greater risk of introducing weaknesses related to insufficient input validation.
Unchecked input is the leading cause of vulnerabilities in J2EE applications. Unchecked input leads to cross-site scripting, process control, and SQL injection vulnerabilities, among others. 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.
Potential Impact
Integrity
Unexpected State
Demonstrative Examples
public class RegistrationForm extends org.apache.struts.action.ActionForm {
// private variables for registration form
private 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 form
private String name;private String email;...
public RegistrationForm() {super();}
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {...}
// getter and setter methods for private variables
...
}<struts-config>
<form-beans><form-bean name="RegistrationForm" type="RegistrationForm"/></form-beans>
...
<!-- ========================= Validator plugin ================================= --><plug-in className="org.apache.struts.validator.ValidatorPlugIn"><set-propertyproperty="pathnames"value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in>
</struts-config>Mitigations & Prevention
Use an input validation framework such as Struts.
Use an input validation framework such as Struts.
Use the Struts Validator to validate all program input before it is processed by the application. Ensure that there are no holes in the configuration of the Struts Validator. Example uses of the validator include checking to ensure that:
Use the Struts Validator to validate all program input before it is processed by the application. Ensure that there are no holes in the configuration of the Struts Validator. Example uses of the validator include checking to ensure that:
Related Weaknesses
Taxonomy Mappings
- 7 Pernicious Kingdoms: — Struts: Plug-in Framework Not In Use
Frequently Asked Questions
What is CWE-106?
CWE-106 (Struts: Plug-in Framework not in Use) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Variant-level weakness. When an application does not use an input validation framework such as the Struts Validator, there is a greater risk of introducing weaknesses related to insufficient input validation.
How can CWE-106 be exploited?
Attackers can exploit CWE-106 (Struts: Plug-in Framework not in Use) to unexpected state. This weakness is typically introduced during the Implementation phase of software development.
How do I prevent CWE-106?
Key mitigations include: Use an input validation framework such as Struts.
What is the severity of CWE-106?
CWE-106 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.