CWE-103 Variant Draft

Struts: Incomplete validate() Method Definition

This vulnerability occurs in a Struts application when a validator form either completely omits a validate() method or includes one but fails to call super.validate() within it.

Definition

What is CWE-103?

This vulnerability occurs in a Struts application when a validator form either completely omits a validate() method or includes one but fails to call super.validate() within it.
In the Struts validation framework, the super.validate() call is essential because it triggers the framework's built-in validation logic. Without this call, the framework cannot process the validation rules defined for the form, effectively leaving the form's input unchecked and allowing potentially malicious or malformed data to proceed. As a result, the entire validation layer for that specific form is disabled, creating a security gap where attackers can bypass intended data checks. Developers must ensure every custom validate() method explicitly invokes super.validate() to maintain the security chain and enforce all configured validation constraints.
Auswirkungen in der Praxis

Real-world CVEs caused by CWE-103

Bisher sind in MITREs Katalog keine öffentlichen CVE-Referenzen mit dieser CWE verknüpft.

Wie Angreifer es ausnutzen

Angreiferpfad Schritt für Schritt

  1. 1

    Identifiziere einen Codepfad, der nicht vertrauenswürdige Eingaben ohne Validierung verarbeitet.

  2. 2

    Erzeuge eine Payload, die das unsichere Verhalten auslöst — Injection, Traversal, Overflow oder Logik-Missbrauch.

  3. 3

    Liefere die Payload über einen normalen Request aus und beobachte die Reaktion der Anwendung.

  4. 4

    Iteriere, bis die Antwort Daten preisgibt, Angreifer-Code ausführt oder Berechtigungen eskaliert.

Verwundbares Codebeispiel

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 the RegistrationForm bean in the Struts framework will maintain the user data. Tthe RegistrationForm class implements the validate method to validate the user input entered into the form.

Verwundbar Java
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) {
  		ActionErrors errors = new ActionErrors();
  		if (getName() == null || getName().length() < 1) {
  			errors.add("name", new ActionMessage("error.name.required"));
  		}
  		return errors;
  	}
  	// getter and setter methods for private variables
  	...
  }
Sicheres Codebeispiel

Secure Java

Although the validate method is implemented in this example the method does not call the validate method of the ValidatorForm parent class with a call super.validate(). Without the call to the parent validator class only the custom validation will be performed and the default validation will not be performed. The following example shows that the validate method of the ValidatorForm class is called within the implementation of the validate method.

Sicher Java
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) {
  			ActionErrors errors = super.validate(mapping, request);
  			if (errors == null) {
  				errors = new ActionErrors();
  			}
  		if (getName() == null || getName().length() < 1) {
  			errors.add("name", new ActionMessage("error.name.required"));
  		}
  		return errors;
  }
  	// getter and setter methods for private variables
  	...
  }
What changed: the unsafe sink is replaced (or the input is validated/escaped) so the same payload no longer triggers the weakness.
Präventions-Checkliste

How to prevent CWE-103

  • Implementation Implement the validate() method and call super.validate() within that method.
Erkennungssignale

How to detect CWE-103

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

Plexicus Auto-Fix

Plexicus erkennt CWE-103 automatisch und öffnet in unter 60 Sekunden einen Fix-PR.

Codex Remedium scannt jeden Commit, identifiziert genau diese Schwachstelle und liefert einen reviewer-ready Pull Request mit dem Patch. Keine Tickets. Keine Hand-offs.

Häufig gestellte Fragen

Frequently asked questions

Was ist CWE-103?

This vulnerability occurs in a Struts application when a validator form either completely omits a validate() method or includes one but fails to call super.validate() within it.

Wie gravierend ist CWE-103?

MITRE hat für diese Schwachstelle keine Exploit-Wahrscheinlichkeit veröffentlicht. Behandle sie als mittlere Auswirkung, bis dein Threat Model anderes belegt.

Welche Sprachen oder Plattformen sind von CWE-103 betroffen?

MITRE lists the following affected platforms: Java.

Wie kann ich CWE-103 verhindern?

Implement the validate() method and call super.validate() within that method.

Wie erkennt und behebt Plexicus CWE-103?

Die SAST-Engine von Plexicus erkennt die Datenfluss-Signatur von CWE-103 bei jedem Commit. Bei einem Treffer öffnet unser Codex-Remedium-Agent einen Fix-PR mit korrigiertem Code, Tests und einer einzeiligen Zusammenfassung für den Reviewer.

Wo erfahre ich mehr über CWE-103?

MITRE veröffentlicht die kanonische Definition unter https://cwe.mitre.org/data/definitions/103.html. Für ergänzende Hinweise kannst du auch die OWASP- und NIST-Dokumentation heranziehen.

Verwandte Schwachstellen

Weaknesses related to CWE-103

CWE-573 Parent

Improper Following of Specification by Caller

This weakness occurs when software fails to properly follow the documented rules, protocols, or requirements of an external component it…

CWE-104 Sibling

Struts: Form Bean Does Not Extend Validation Class

This vulnerability occurs in Apache Struts applications when a form bean class does not properly extend the framework's validation class.…

CWE-243 Sibling

Creation of chroot Jail Without Changing Working Directory

This vulnerability occurs when a program creates a chroot jail but fails to change its current working directory afterward. Because the…

CWE-253 Sibling

Incorrect Check of Function Return Value

This vulnerability occurs when a program misinterprets or improperly validates the return value from a function, causing it to miss…

CWE-296 Sibling

Improper Following of a Certificate's Chain of Trust

This vulnerability occurs when software fails to properly validate the entire certificate chain back to a trusted root authority. This…

CWE-304 Sibling

Missing Critical Step in Authentication

This vulnerability occurs when a software authentication process omits a required step, weakening its overall security.

CWE-325 Sibling

Missing Cryptographic Step

This vulnerability occurs when a software implementation skips a critical step in a cryptographic process, resulting in security that is…

CWE-329 Sibling

Generation of Predictable IV with CBC Mode

This vulnerability occurs when software uses a predictable or reused Initialization Vector (IV) with Cipher Block Chaining (CBC) mode…

CWE-358 Sibling

Improperly Implemented Security Check for Standard

This vulnerability occurs when software fails to correctly implement one or more critical security checks required by a standard protocol,…

Bereit, wenn du es bist

Schluss mit dem Bezahlen pro Entwickler.
Schließ den Kreislauf.

Plexicus ist die KI-native ASPM, die scannt, filtert, fixt, pentestet und erklärt — autonom. Unbegrenzte Entwickler, unbegrenzte Repos, Fair-Use-KI-Aktionen. Echter kostenloser Tarif, €269/mo jährlich, wenn du bereit bist.