Summary
mall4j through version 4.0 contains a critical missing-authentication vulnerability in the password update endpoint. An unauthenticated attacker may provide a target storefront username and reset its password, potentially taking over accounts and accessing associated orders and personal data.
Affected context
The vulnerability occurs in mall4j deployments that expose the PUT /user/updatePwd endpoint without requiring a valid authenticated session or another reliable account-verification factor. Risk is highest where the endpoint is reachable by untrusted network clients and accepts a target username without confirming authorization to change that account's password.
Exploit preconditions
- Attack surface: The storefront user password-update API
- Required access: Network access to the endpoint; prior authentication may not be required
- Trigger point: Processing a password-change request containing a target account identifier
- Why exploitation is possible: The endpoint permits password replacement without authenticating the requester or verifying control of the target account
Why this happens
The underlying flaw is an authorization boundary failure: a sensitive account-management operation is exposed without an effective authentication and ownership check. This maps to CWE-306: Missing Authentication for Critical Function, because the application allows a critical function—changing an account password—to proceed without establishing the identity of the requester or confirming that the requester may modify the selected account.
Potential impact
- Attackers may take over storefront accounts
- Unauthorized users could access orders, profiles, and personal data
- Compromised accounts may be used for fraud or abuse
- Attackers could change account details or disrupt legitimate access
- Multiple customer accounts could be affected through repeated requests
General mitigation guidance
Mitigation generally focuses on protecting password changes with strong identity and authorization controls.
Common defensive patterns include:
- Require an authenticated session before permitting password changes
- Verify that the requester owns the account identified by the operation
- Use reauthentication, current-password confirmation, or a separate account-recovery proof for sensitive changes
- Avoid trusting user-supplied account identifiers when the identity can be derived from the authenticated session
- Apply rate limits, monitoring, and abuse controls to password-management endpoints
- Enforce least privilege and invalidate active sessions or tokens after a confirmed password change where appropriate
How teams detect issues like this
Organizations can identify similar weaknesses through:
- Static analysis and API security rules targeting unauthenticated sensitive operations
- Code review checks for password-change handlers that lack authentication, ownership, or reauthentication checks
- Endpoint inventories that compare account-management routes with required authentication policies
- Dynamic testing that verifies anonymous requests cannot modify another account
- Gateway or policy enforcement requiring authentication and authorization for user-management APIs
- Logging and alerting for repeated password-reset attempts, unusual target-account changes, and requests from unauthenticated clients

