Summary
efw4.X's <efw:elFinder> JSP tag exposes a logic flaw where the server-side readonly flag is not actually enforced before performing file write operations.
Even when readonly=true and the UI appears locked, an attacker who sends crafted requests directly to the backend can still perform arbitrary file modifications.
Affected context
This vulnerability appears in deployments of efw4.X prior to version 4.08.010 that use the <efw:elFinder> JSP tag to present a file management interface.
It manifests when the tag is configured with readonly=true and protected=true under the assumption that this will prevent any write operations on the server.
In practice, the readonly flag is only honored in the client UI state and response metadata, while the underlying server-side handlers accept and process write-capable requests regardless of the readonly setting.
Exploit preconditions
- Attack surface: HTTP endpoints backing the <efw:elFinder> file manager functionality.
- Required access: Ability to reach the efw4.X application and send crafted requests (typically authenticated to the level required to access the file manager at all).
- Trigger point: Direct invocation of file operation endpoints (e.g., upload, delete, rename, move, edit) with parameters that request write operations, bypassing any client-side UI restrictions.
- Why exploitation is possible: Authorization decisions rely on the client-supplied readonly flag and UI controls, and no server-side handler validates the readonly state before executing write operations, leading to missing authorization enforcement (CWE-863).
Why this happens
The core issue is a server-side authorization gap: the readonly flag is treated as a client-state hint rather than an enforced policy.
The efw4.X implementation ensures readonly=true is echoed back from the client when protected=true, but does not bind this flag to the actual execution path of write operations.
File operations are performed solely based on the received request without re-checking a trusted server-side authorization source, resulting in missing authorization checks (CWE-863).
Conceptually, this reflects a broken access control pattern where UI constraints and response metadata are mistaken for true access enforcement.
Potential impact
- An attacker can modify files that should be protected as read-only.
- Protected files and directories may be deleted, moved, renamed, or overwritten.
- Malicious files (e.g., web shells, backdoors, or altered configuration files) can be uploaded into the application's file space.
- Integrity of application resources, logs, or user content can be compromised.
- In some deployments, arbitrary file manipulation could enable further escalation, including remote code execution, depending on where files are stored and how they are used.
General mitigation guidance
Effective mitigation focuses on enforcing access control decisions on the server and decoupling them from any client-provided state:
- Ensure that all file write operations (upload, delete, rename, move, edit, mkdir, etc.) consult a server-side authorization policy that uses trusted session or role data, not client parameters, to decide whether the operation is permitted.
- Treat readonly as a server-side property of the current context (user, role, mount point, or directory) and enforce it within every handler that can change the file system.
- Avoid relying on UI controls or client flags to enforce security; treat them only as hints for user experience.
- Apply the principle of least privilege by reducing which users or roles can access write-capable endpoints and by segmenting file areas with stricter policies for sensitive directories.
- Consider using centralized authorization middleware or policy engines so that file operation permissions are defined once and consistently applied across all related endpoints.
How teams detect issues like this
Detection can rely on both code-level analysis and runtime monitoring:
- Static analysis and code review:
- Search for file operation handlers (upload, delete, rename, move, edit) that lack explicit checks against a server-side readonly or permission model.
- Flag any access control decisions that depend on client-supplied parameters (e.g., readonly request fields) instead of trusted session attributes or server-configured policies.
- Review uses of the <efw:elFinder> tag to verify that readonly configuration is enforced in backend logic, not only in JSP or JavaScript.
- Policy and automated checks:
- Implement CI rules that require an authorization check pattern around all file system modifying methods.
- Use automated security testing tools or custom scripts to send crafted requests that attempt write operations while the UI is configured as read-only, and alert on success.
- Runtime monitoring:
- Log all file write actions along with user identity, source IP, and UI state, and alert on write operations occurring in contexts marked as read-only.

