Run static analysis (SAST) on the codebase looking for the unsafe pattern in the data flow.
Struts: Plug-in Framework not in Use
This weakness occurs when a Java application, particularly one using the Struts framework, does not implement a structured input validation plugin like the Struts Validator. Skipping this framework…
What is CWE-106?
Real-world CVEs caused by CWE-106
No public CVE references are linked to this CWE in MITRE's catalog yet.
Step-by-step attacker path
- 1
In the following Java 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.
- 2
However, the RegistrationForm class extends the Struts ActionForm class which does use the Struts validator plug-in to provide validator capabilities. In the following example, the RegistrationForm Java class extends the ValidatorForm and Struts configuration XML file, struts-config.xml, instructs the application to use the Struts validator plug-in.
- 3
The plug-in tag of the Struts configuration XML file includes the name of the validator plug-in to be used and includes a set-property tag to instruct the application to use the file, validator-rules.xml, for default validation rules and the file, validation.XML, for custom validation.
Vulnerable Java
In the following Java 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.
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*
...
} Secure Java
However, the RegistrationForm class extends the Struts ActionForm class which does use the Struts validator plug-in to provide validator capabilities. In the following example, the RegistrationForm Java class extends the ValidatorForm and Struts configuration XML file, struts-config.xml, instructs the application to use the Struts validator plug-in.
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*
...
} How to prevent CWE-106
- Architecture and Design Use an input validation framework such as Struts.
- Architecture and Design Use an input validation framework such as Struts.
- Implementation 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: - Phone number fields contain only valid characters in phone numbers - Boolean values are only "T" or "F" - Free-form strings are of a reasonable length and composition
- Implementation 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: - Phone number fields contain only valid characters in phone numbers - Boolean values are only "T" or "F" - Free-form strings are of a reasonable length and composition
How to detect CWE-106
Run dynamic application security testing against the live endpoint.
Watch runtime logs for unusual exception traces, malformed input, or authorization bypass attempts.
Code review: flag any new code that handles input from this surface without using the validated framework helpers.
Plexicus auto-detects CWE-106 and opens a fix PR in under 60 seconds.
Codex Remedium scans every commit, identifies this exact weakness, and ships a reviewer-ready pull request with the patch. No tickets. No hand-offs.
Frequently asked questions
What is CWE-106?
This weakness occurs when a Java application, particularly one using the Struts framework, does not implement a structured input validation plugin like the Struts Validator. Skipping this framework forces developers to write custom validation logic, which is often error-prone and increases the risk of security flaws from improperly handled user input.
How serious is CWE-106?
MITRE has not published a likelihood-of-exploit rating for this weakness. Treat it as medium-impact until your threat model proves otherwise.
What languages or platforms are affected by CWE-106?
MITRE lists the following affected platforms: Java.
How can I prevent CWE-106?
Use an input validation framework such as Struts. Use an input validation framework such as Struts.
How does Plexicus detect and fix CWE-106?
Plexicus's SAST engine matches the data-flow signature for CWE-106 on every commit. When a match is found, our Codex Remedium agent opens a fix PR with the corrected code, tests, and a one-line summary for the reviewer.
Where can I learn more about CWE-106?
MITRE publishes the canonical definition at https://cwe.mitre.org/data/definitions/106.html. You can also reference OWASP and NIST documentation for adjacent guidance.
Weaknesses related to CWE-106
Improper Use of Validation Framework
This vulnerability occurs when a software application either fails to use or incorrectly implements a built-in or library-provided input…
Struts: Duplicate Validation Forms
This vulnerability occurs when an application defines multiple Struts validation forms with identical names. The framework then…
Struts: Form Field Without Validator
This vulnerability occurs when a Struts application form contains an input field that lacks a corresponding validator, leaving it open to…
Struts: Unvalidated Action Form
In Apache Struts, every Action Form that processes user input must have a corresponding validation form configured. Missing this…
Struts: Validator Turned Off
This vulnerability occurs when an application built with Apache Struts intentionally disables its built-in validation framework. By…
ASP.NET Misconfiguration: Improper Model Validation
This vulnerability occurs when an ASP.NET application either completely bypasses the built-in model validation system or implements it…
ASP.NET Misconfiguration: Not Using Input Validation Framework
This vulnerability occurs when an ASP.NET application fails to implement a structured input validation framework, relying instead on…
Further reading
- MITRE — official CWE-106 https://cwe.mitre.org/data/definitions/106.html
- Seven Pernicious Kingdoms: A Taxonomy of Software Security Errors https://samate.nist.gov/SSATTM_Content/papers/Seven%20Pernicious%20Kingdoms%20-%20Taxonomy%20of%20Sw%20Security%20Errors%20-%20Tsipenyuk%20-%20Chess%20-%20McGraw.pdf
Don't Let Security
Weigh You Down.
Stop choosing between AI velocity and security debt. Plexicus is the only platform that runs Vibe Coding Security and ASPM in parallel — one workflow, every codebase.