CWE-608

Struts: Non-private Field in ActionForm Class

Medium

Description

An ActionForm class contains a field that has not been declared private, which can be accessed without using a setter or getter.

Potential Impact

How to Fix

Implementation

Make all fields private. Use getter to get the value of the field. Setter should be used only by the framework; setting an action form field from other actions is bad practice and should be avoided.

Detection Methods

Related Weaknesses

References

View on MITRE CWE Database →

Need Help Fixing This Vulnerability?

Our security experts can help you identify and remediate CWE-608 vulnerabilities in your codebase.

Get Security Assessment