---
title: "CWE-105: Struts: Form Field Without Validator"
url: https://radicalnotion.ai/cwe/cwe-105
type: cwe
description: "The product has a form field that is not validated by a corresponding validation form, which can introduce other weaknesses related to insufficient input validation."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-105: Struts: Form Field Without Validator

- **Abstraction:** Variant
- **Structure:** Simple
- **Status:** Draft
- **CVEs with this as primary weakness:** 0
- **Of those, in CISA KEV:** 0
- **New in 2026:** 0
- **CWE catalog version:** 4.21

## Description

The product has a form field that is not validated by a corresponding validation form, which can introduce other weaknesses related to insufficient input validation.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | Some products use the same ActionForm for more than one purpose. In situations like this, some fields may go unused under some action mappings. |

## Applicable platforms

**Languages:** Java (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Integrity | Unexpected State | Omitting validation for even a single input field may give attackers the leeway they need to compromise the product. 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. |
| 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

### Implementation

Validate all form fields. If a field is unused, it is still important to constrain it so that it is empty or undefined.

## Detection methods

### Automated Static Analysis

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 searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

## 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.

Result code:

```
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
    ...
}
```

Bad code:

```xml
<form-validation>
    <formset>
        <form name="RegistrationForm">
            <field property="name" depends="required">
                <arg position="0" key="prompt.name"/>
            </field>
            <field property="address" depends="required">
                <arg position="0" key="prompt.address"/>
            </field>
            <field property="city" depends="required">
                <arg position="0" key="prompt.city"/>
            </field>
            <field property="state" depends="required,mask">
                <arg position="0" key="prompt.state"/>
                <var>
                    <var-name>mask</var-name>
                    <var-value>[a-zA-Z]{2}</var-value>
                </var>
            </field>
            <field property="zipcode" depends="required,mask">
                <arg position="0" key="prompt.zipcode"/>
                <var>
                    <var-name>mask</var-name>
                    <var-value>\d{5}</var-value>
                </var>
            </field>
        </form>
    </formset>
</form-validation>
```

Good code:

```xml
<form-validation>
    <formset>
        <form name="RegistrationForm">
            <field property="name" depends="required">
                <arg position="0" key="prompt.name"/>
            </field>
            <field property="address" depends="required">
                <arg position="0" key="prompt.address"/>
            </field>
            <field property="city" depends="required">
                <arg position="0" key="prompt.city"/>
            </field>
            <field property="state" depends="required,mask">
                <arg position="0" key="prompt.state"/>
                <var>
                    <var-name>mask</var-name>
                    <var-value>[a-zA-Z]{2}</var-value>
                </var>
            </field>
            <field property="zipcode" depends="required,mask">
                <arg position="0" key="prompt.zipcode"/>
                <var>
                    <var-name>mask</var-name>
                    <var-value>\d{5}</var-value>
                </var>
            </field>
            <field property="phone" depends="required,mask">
                <arg position="0" key="prompt.phone"/>
                <var>
                    <var-name>mask</var-name>
                    <var-value>^([0-9]{3})(-)([0-9]{4}|[0-9]{4})$</var-value>
                </var>
            </field>
            <field property="email" depends="required,email">
                <arg position="0" key="prompt.email"/>
            </field>
        </form>
    </formset>
</form-validation>
```

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-20](https://radicalnotion.ai/cwe/cwe-20) | Improper Input Validation |
| Parent | [CWE-1173](https://radicalnotion.ai/cwe/cwe-1173) | Improper Use of Validation Framework |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| 7 Pernicious Kingdoms | Struts: Form Field Without Validator | - | - |
| Software Fault Patterns | Tainted input to command | SFP24 | - |

## Frequently asked questions

### What is CWE-105?

The product has a form field that is not validated by a corresponding validation form, which can introduce other weaknesses related to insufficient input validation.

### How do you prevent CWE-105?

Validate all form fields. If a field is unused, it is still important to constrain it so that it is empty or undefined.

### How is CWE-105 detected?

Automated Static Analysis: 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 searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

### What are the consequences of CWE-105?

Exploiting CWE-105 can lead to: Unexpected State, Bypass Protection Mechanism.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/105.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-105). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
