Variant · Low-Medium

CWE-110: Struts: Validator Without Form Field

Validation fields that do not appear in forms they are associated with indicate that the validation logic is out of date.

CWE-110 · Variant Level

Description

Validation fields that do not appear in forms they are associated with indicate that the validation logic is out of date.

It is easy for developers to forget to update validation logic when they make changes to an ActionForm class. One indication that validation logic is not being properly maintained is inconsistencies between the action form and the validation form. 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

Other

Other

Demonstrative Examples

This example shows an inconsistency between an action form and a validation form. with a third field.
This first block of code shows an action form that has two fields, startDate and endDate.
Bad
public class DateRangeForm extends ValidatorForm {
                        String startDate, endDate;
                           public void setStartDate(String startDate) {this.startDate = startDate;}
                           public void setEndDate(String endDate) {this.endDate = endDate;}
                     }
This second block of related code shows a validation form with a third field: scale. The presence of the third field suggests that DateRangeForm was modified without taking validation into account.
Bad
<form name="DateRangeForm"><field property="startDate" depends="date"><arg0 key="start.date"/></field><field property="endDate" depends="date"><arg0 key="end.date"/></field><field property="scale" depends="integer"><arg0 key="range.scale"/></field></form>

Detection Methods

  • Automated Static Analysis Moderate — To find the issue in the implementation, manual checks or automated static analysis could be applied to the XML configuration files.
  • Manual Static Analysis Moderate — To find the issue in the implementation, manual checks or automated static analysis could be applied to the XML configuration files.

Taxonomy Mappings

  • 7 Pernicious Kingdoms: — Struts: Validator Without Form Field
  • Software Fault Patterns: SFP24 — Tainted input to command

Frequently Asked Questions

What is CWE-110?

CWE-110 (Struts: Validator Without Form Field) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Variant-level weakness. Validation fields that do not appear in forms they are associated with indicate that the validation logic is out of date.

How can CWE-110 be exploited?

Attackers can exploit CWE-110 (Struts: Validator Without Form Field) to other. This weakness is typically introduced during the Implementation, Operation phase of software development.

How do I prevent CWE-110?

Follow secure coding practices, conduct code reviews, and use automated security testing tools (SAST/DAST) to detect this weakness early in the development lifecycle.

What is the severity of CWE-110?

CWE-110 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.